-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes Listing Info Retrieval Handling when Slow #4
Conversation
Delays the timeout for retrieving to 10ms. In the vast majority of cases, it will be retrieved in under 10ms. If it still takes longer, `retrieveListingInfoFromPage` rejects the promise. If the promise is rejected for a single listing, the listing text is updated (to prevent an infinite loop if they're on a new page). If the promise is rejected for 'Get all floats', it tries again.
I'd say a better approach would be to store all the promises we need to resolve somewhere, then when we receive the message from the page in the event handler, resolve them all. That way, we wouldn't need to worry about the exact amount of time. |
@bmwalters I just finished my commit as I saw yours, haha. I think my approach is pretty clean and just stores the resolve objects. If the id isn't in the listing data on an individual listing, it silently fails and the user must have switched pages. This approach also allows us to get rid of the reject handlers like before, but I guess it is helpful at times to have them so.... |
@bmwalters Which approach would you go with? |
* Add release workflow * Add version checking script * Lmao * Revert * Test * Test * Woops * Bumps Version to v3.2.1 * Add prettier * Prettified Code! * ??? * Prettified Code! * Bumps Version to v3.3.0 * Add the real release * Delete zip * Bumps Version to v5.0.0 * Woops * woooow * Bumps Version to v6.0.0 * dam * Bumps Version to v7.0.0 * Convert to pr * Correct pr creation * Bumps Version to v8.0.0 * ?? * Bumps Version to v9.0.0 * Bumps Version to v10.0.0 (#4) Co-authored-by: GitHub Action <action@github.com> * Revert * Bumps Version to v12.0.0 * Add token * Bumps Version to v14.0.0 * Change access token name * Set prettier options * Bumps Version to v15.0.0 * Wtf * Bumps Version to v16.0.0 * ? * Bumps Version to v17.0.0 * Test * Bumps Version to v18.0.0 * Wtf * Bumps Version to v19.0.0 * Final * Add suggestions * Remove relative path * Bumps Version to v20.0.0 * Revert "Bumps Version to v20.0.0" This reverts commit d65c5bd. * Try new prettier options * Bumps Version to v21.0.0 * Revert "Bumps Version to v21.0.0" This reverts commit 88ba221. * Revert changes * Bumps Version to v22.0.0 * ??? * Bumps Version to v23.0.0 * lol * Bumps Version to v24.0.0 * Lol * Bumps Version to v25.0.0 * Hm * Bumps Version to v26.0.0 * Wow * Only format changed files * Hardcode version * Bumps Version to v30.0.0 * Bumps Version to v32.0.0 * Undo version update --------- Co-authored-by: ayoung19 <ayoung19@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Issue:
Sometimes the page doesn't reply with listing info fast enough and
retrieveListingInfoFromPage
returns null data in the promise.Fix:
Delays the timeout for retrieving to 10ms. In the vast majority of
cases, it will be retrieved in under 10ms. If it still takes longer,
retrieveListingInfoFromPage
rejects the promise. If the promise isrejected for a single listing, the listing text is updated (to prevent
an infinite loop if they're on a new page). If the promise is rejected
for 'Get all floats', it tries again.