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

Fix: Persist filters after web page reload #692

Merged
merged 8 commits into from
May 30, 2024

Conversation

mayan-000
Copy link
Collaborator

@mayan-000 mayan-000 commented May 28, 2024

Description

This PR adds code to persist filters when the user refreshes the web page.

Relevant Technical Choices

  • When the table is opened, saved filters are extracted and applied.
  • As time moves, the user keeps selecting filters, and we keep updating the storage.
  • When the user navigates to another table, we extract and apply filters.
  • So the flow continues to open the PSAT panel, open the table, apply filters, navigate to other tables, and close the PSAT.
  • But if we count the reloading of the page as a step to fulfill, the data gets lost, how?
  • During the debugging process, when the table is opened the first time we extract saved filters, let's say this time as T1.
  • As the user starts selecting different filters and reaches time T4.
  • During this time frame, storage has been updated but the local state storing extracted saved filters on T1 is still not updated, why? Because it was supposed to be updated when the user navigates to another table.
  • But if the user reloads the web page, we lose filters between T1 and T4, why?
  • Because the extraction cue hasn't been triggered(which is navigating into the table), and due to this we still operate on data stored on T1.
  • The old data from T1 will not be able to apply changes between T1 and T4.

To solve this issue:

  • The data flow has to be changed, for this, we'll use a variable that'll keep a reference of extracted saved filters and the latest updates on filters. So that we don't lose data during any time frame.
  • With this, we'll always have the latest filters saved and can be applied for any data change, be it reloading also.

Testing Instructions

  • Open the PSAT panel and navigate to the cookie table.
  • Open the filters sidebar and select some filters.
  • Now reload the webpage being analyzed.
  • The filters should remain consistent and present as per cookies data available at a certain time frame.

Additional Information:

Screenshot/Screencast

Screen.Recording.2024-05-29.at.16.30.39.mov

Checklist

  • I have thoroughly tested this code to the best of my abilities.
  • I have reviewed the code myself before requesting a review.
  • This code is covered by unit tests to verify that it works as intended.
  • The QA of this PR is done by a member of the QA team (to be checked by QA).

Fixes #690

@mayan-000 mayan-000 changed the title Fix: Fix: Persist filters after web page reload May 28, 2024
@mayan-000 mayan-000 self-assigned this May 29, 2024
@mayan-000 mayan-000 requested a review from mohdsayed May 29, 2024 11:07
@mayan-000 mayan-000 marked this pull request as ready for review May 29, 2024 11:07
@mohdsayed mohdsayed added this to the v1.0.0 milestone May 30, 2024
@mohdsayed mohdsayed added the bug Something isn't working label May 30, 2024
@mohdsayed mohdsayed merged commit f9729b5 into develop May 30, 2024
4 checks passed
@mohdsayed mohdsayed deleted the fix/filters-persistence branch May 30, 2024 06:48
@mohdsayed mohdsayed mentioned this pull request Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants