You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a somewhat complicated scenario I encountered while testing a different feature. I've investigated deeply enough to prove that the bad behavior I'm seeing is based on the wrong UI state, rather than the wrong PCDCollection state, but I haven't managed to figure out why the UI isn't updating.
Here's the test scenario:
Use consumer-client to create 2 semaphore signature PCDs: "1" and "2"
Open 2 Zupass tabs both looking at the root folder.
In Tab 1, delete signature PCD 1
In Tab 2, delete signature PCD 2
The log in Tab 2 shows that a merge occurred, and both of the removed PCDs were kept (as expected). However the UI in Tab 2 still shows only 1 signature PCD. It updated after the removal, but not after the merge which brought back the PCD.
Wait a while for both tabs to perform a background sync. At that point, the UI will update and both tabs show both signature PCDs again.
Note that there are some spurious uploads after the initial merge caused by #1340. I'm not sure if that's related to why the UI eventually updates.
Below is a trace of the merge with some extra logging counting PCDs at various points, and counting the results of some appHooks in the UI. In this test case, before removals, my user has 864 PCDs (including the 2 signatures) and the root folder has 4 PCDS (including the 2 signatures). The surprising part is that after the download merge completes (resulting in 864 PCDs, 2 signatures), the UI re-renders with only 3 PCDs in the root folder. The next doSync() call again has all PCDs, but there's never another call to usePCDsInFolder until the next periodic poll occurs.
Oddly, download is a case where the PCDCollection is always replaced with a whole new object (not just mutating the existing one) so I'd expect React to have no trouble detecting the changes and rendering.
The text was updated successfully, but these errors were encountered:
This is a somewhat complicated scenario I encountered while testing a different feature. I've investigated deeply enough to prove that the bad behavior I'm seeing is based on the wrong UI state, rather than the wrong PCDCollection state, but I haven't managed to figure out why the UI isn't updating.
Here's the test scenario:
Note that there are some spurious uploads after the initial merge caused by #1340. I'm not sure if that's related to why the UI eventually updates.
Below is a trace of the merge with some extra logging counting PCDs at various points, and counting the results of some appHooks in the UI. In this test case, before removals, my user has 864 PCDs (including the 2 signatures) and the root folder has 4 PCDS (including the 2 signatures). The surprising part is that after the download merge completes (resulting in 864 PCDs, 2 signatures), the UI re-renders with only 3 PCDs in the root folder. The next doSync() call again has all PCDs, but there's never another call to usePCDsInFolder until the next periodic poll occurs.
Oddly, download is a case where the PCDCollection is always replaced with a whole new object (not just mutating the existing one) so I'd expect React to have no trouble detecting the changes and rendering.
The text was updated successfully, but these errors were encountered: