Skip to content
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

[Bug]: Merchants are Incorrectly Reported #15

Open
alairon opened this issue May 21, 2022 · 0 comments · May be fixed by #16
Open

[Bug]: Merchants are Incorrectly Reported #15

alairon opened this issue May 21, 2022 · 0 comments · May be fixed by #16

Comments

@alairon
Copy link
Contributor

alairon commented May 21, 2022

Describe the bug
Merchant sightings are being overwritten over a period of time when the client receives additional data, leaving the page to assume that there were no sightings. The data being pulled is correct when the client loads the data in for the first time.

To Reproduce
Steps to reproduce the behavior:

  1. Open the merchants page any time while the merchants are active (this is more apparent if done right as the merchants spawn and no data is present)
  2. Leave it open without refreshing or modifying any settings

Expected behavior
All of the merchants that have votes remain on the page throughout the entire window

Screenshots
I wasn't able to take a screenshot of the page by the time they disappeared, but I took notes of the WebSocket data in Additional Context below

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Edge (Chrome)
  • Version: 101.0.1210.47

Additional context

I think the problem is in pages/merchants.tsx and is caused when the page merges the merchantAPIData and apiData after it receives new data from SaintBot. The keys from apiData overwrites the values that are present in merchantAPIData.

An observation of the WebSocket data for US East, Azena on 2022-05-21 from 17:38 to 17:55 EDT:

Time WebSocket Data Notes
17:38
  1. Oliver
  2. Jeffrey (1 item)
  3. Jeffrey (2 items)
  4. Nox
  5. Malone
  6. Morris
First loaded the page at 17:38 with this payload
17:38
  1. Jeffrey (2 items)
A second vote for Jeffrey with a corrected list of good items.
The entry for Oliver gets overwritten and disappears
17:39
  1. Lucas
A vote for Lucas
The first entry for Jeffrey is overwritten, but still appears because of the redundant entries
17:40
  1. Mac
  2. Mac
Two votes for Mac.
Lucas and Jeffrey are now overwritten. Jeffrey at index 2 still has data and remains listed
17:41
  1. Rayni
A vote for Rayni at Starsand Beach
The first Mac entry gets overwritten
17:42
  1. Rayni
A vote for Rayni at Secret Forest, overriding the vote for Starsand Beach
17:46
  1. Dorella
A vote for Dorella
Rayni was overwritten
17:49
  1. Rayni
The WebSocket resends the info for Rayni
Dorella was overwritten
17:50
  1. Aricer
A vote for Aricer
Rayni was overwritten
17:51
  1. Burt
A vote for Burt
Aricer was overwritten

The final data stack and what we ultimately see on the website before the merchants packed up shop for the hour:

  1. Burt
  2. Mac
  3. Jeffrey
  4. Nox
  5. Malone
  6. Morris

Oliver, Lucas, Rayni, Dorella, and Aricer all report "Unknown" on the website because their keys were overwritten.

Screenshot of all the votes that were logged on SaintBot
AllVotes

@alairon alairon linked a pull request May 23, 2022 that will close this issue
12 tasks
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 a pull request may close this issue.

1 participant