Skip to content

Fix marketSearch parsing errors escaping the callback - #376

Open
tarikermis wants to merge 1 commit into
DoctorMcKay:masterfrom
tarikermis:fix/market-search-parser-errors
Open

tarikermis wants to merge 1 commit into
DoctorMcKay:masterfrom
tarikermis:fix/market-search-parser-errors

Conversation

@tarikermis

Copy link
Copy Markdown

Fixes #198.

A malformed percent-encoded item name makes marketSearch() throw a URIError from its HTTP response handler, so callers cannot handle the failure through their callback.

This catches listing-parser errors and passes them to the existing error-first callback. Parsing stops on the failing page without returning partial results. Valid names still decode normally, and exceptions thrown by the caller’s callback still propagate.

Verification: node test/marketSearch.malformedUri.test.js passes with mocked responses covering malformed UTF-8, invalid percent escapes, valid Unicode, pagination, and callback exceptions. The same test fails against unchanged upstream code with the malformed-URI error. node --check classes/CMarketSearchResult.js and git diff --check also pass. No live Steam requests were used.

Best Regards, Tarik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

marketSearch breaks on weirdly named items

1 participant