Skip to content

[Bug]: Merchants are Incorrectly Reported #15

Open
@alairon

Description

@alairon

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions