Multiwoven / multiwoven

🔥🔥🔥 Open Source Alternative to Hightouch, Census, and RudderStack - Reverse ETL & Data Activation
https://squared.ai/multiwoven-reverse-etl
GNU Affero General Public License v3.0
1.14k stars 59 forks source link

Data is getting erased while navigating to other screens #384

Open Mohith93 opened 3 weeks ago

Mohith93 commented 3 weeks ago

Describe the bug In any point during navigating on screen , when User navigates back, Data is getting erased

To Reproduce Steps to reproduce the behavior:

  1. Login into application
  2. On Source/ Destination / Models / Sync hit back
  3. observe

Actual Behaviour: Filled data is getting erased

Expected behavior Data should not get cleared when user navigating back to previous screen.

linear[bot] commented 3 weeks ago

BE-458 In any point of screen , User navigates back, Data is getting erased

xyfer17 commented 2 weeks ago

@Mohith93 @macintushar please assign this issue to me, i would like to resolve this issue.

macintushar commented 1 week ago

@xyfer17 assigned it to you. Would like to know how you are planning on implementing this after you go through the current code.

xyfer17 commented 1 week ago

@macintushar sorry for the delayed response. for the above issue I'm planning to save the form data in localStorage, so it won’t be erased when navigating to other screens.

Here’s the approach I’m thinking of:

  1. state initialization from localStorage: on component mount, I'll check localStorage for any saved form data and pre-fill the form if data is available.
  2. capture form Data on change: as the form changes, I’ll store the data in localStorage to ensure it’s retained across navigation.
  3. clear data on submission: once the form is submitted successfully, I’ll clear the saved data from localStorage.
  4. component unmount handling: I’ll add a beforeunload listener to clear the data if needed when the browser is closed or refreshed.

Let me know if you have any suggestions on above approach or a better approach! 👍

macintushar commented 6 days ago

@xyfer17 need you to think about how you'll manage data if I fill out the form as:

  1. open in account A, fill the form, close it and login with account B
xyfer17 commented 6 days ago

@xyfer17 need you to think about how you'll manage data if I fill out the form as:

  1. open in account A, fill the form, close it and login with account B

@macintushar for this scenario ,if users logout the localStorage would clear ideally and the formData is also removed along with it. so that account B doesn't have the account A data prefilled in the form.