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

saveWorkspaceEffect in editor functionality should be split based on whether state update should be immediate or debounced #1695

Open
hsharriman opened this issue Jan 12, 2024 · 0 comments

Comments

@hsharriman
Copy link
Contributor

hsharriman commented Jan 12, 2024

Describe the bug
Example error message: Error message: Could not retrieve workspace d2cd0f4d-6a19-457f-835f-9edd2f3e06a0

Because of the way that currentWorkspaceState is updated in Recoil, changes made in <500ms are not captured. This is the intended behavior for changes involving text edits, such as editing the sub/sty/dsl files. However, other behaviors should capture all user inputs, such as duplicating workspaces, sharing/switching tabs, etc. We can accomplish this by splitting up the saveWorkspaceEffect in atoms.ts to have both the current debounced version and an un-debounced version that can be triggered on demand. As part of this, we need to investigate whether Recoil allows multiple effects to be registered for one state object.

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'saved' in the editor
  2. make sure to have at least 1 workspace
  3. click "duplicate workspace" many times
  4. try to view each of the duplicated workspaces, you should get error pop-ups indicating that the workspace id could not be found

Expected behavior
Should be able to see each duplicated workspace

Screenshots
Screenshot 2024-01-12 at 5 16 41 PM

Desktop (please complete the following information if applicable):

  • OS: MacOS
  • Browser: Chrome

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Planned
Development

No branches or pull requests

1 participant