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(FormEditor): form cache not being cleared #4290

Merged
merged 2 commits into from
Dec 23, 2023

Conversation

maxpatiiuk
Copy link
Member

Because of stale state, the cache for the form that was edited most recently wasn't getting cleared.

Changed to ref, since using state here didn't make sense in the first place (state isn't used in render). I used state because at the time I followed idea that we should use state whenever possible, and ref only when must, because state would be cleaner and less bug prone. However, today I belive that each has it's place - use state when you need to use the value in the render or dependency array - use ref otherwise

Fixes #1977

@CarolineDenis CarolineDenis added this to the 7.9.4 milestone Dec 18, 2023
@CarolineDenis CarolineDenis linked an issue Dec 18, 2023 that may be closed by this pull request
@pashiav
Copy link
Contributor

pashiav commented Dec 21, 2023

Instructions for testers? @maxpatiiuk So far the cache doesn't seem to be clearing on Chrome.

@maxpatiiuk
Copy link
Member Author

maxpatiiuk commented Dec 22, 2023

  1. Open a form definition in app resources and make an edit
  2. Without reloading the page, open that form and see that changes are visible
  3. Reload the page and see that changes are visible (this is different code pathway than 2)
  4. If 2 or 3 does not work, open incognito browser tab, and make sure changes are visible (if not, then there is a mistake in step 1 - perhaps you edited a form that is overwritten at a different level)

edit: I tested this again just now and it worked for me

Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested this and I was able to see changes without having to reload the page so it seems like it is working.

@CarolineDenis CarolineDenis requested a review from a team December 22, 2023 17:32
@maxpatiiuk maxpatiiuk merged commit bd5793f into xml-editor Dec 23, 2023
9 checks passed
@maxpatiiuk maxpatiiuk deleted the fix-form-cache-buster branch December 23, 2023 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Bust cached app resource on changes
5 participants