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/AB#82958-after-duplicating-application-page-refresh-necessary #915

Open
wants to merge 3 commits into
base: 2.x.x
Choose a base branch
from

Conversation

estelafs
Copy link
Contributor

@estelafs estelafs commented Jan 5, 2024

Description

The problem was after duplicating applications with content, the backend would re-launches the server with updated schema because the resource changes require schema update, so the redirection to the new duplicated application didn't happen with the server down. So if you duplicate an empty application, for example, it will open the new application as it should without problems since the backend doesn't reload the server in this case.

Added a new check in the resource calculated fields updates watch that triggered this schema refresh, so when the calculated fields are updated the server will reload as wanted, but not on the calculated fields permissions updates.

Useful links

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Duplicating applications

Screenshots

dup.webm

Checklist:

( * == Mandatory )

  • * I have set myself as assignee of the pull request
  • * My code follows the style guidelines of this project
  • * Linting does not generate new warnings
  • * I have performed a self-review of my own code
  • * I have put the ticket for review, adding the oort-backend team to the list of reviewers
  • * I have commented my code, particularly in hard-to-understand areas
  • * I have put JSDoc comment in all required places
  • * My changes generate no new warnings
  • * I have included screenshots describing my changes if relevant
  • * I have selected labels in the Pull Request, according to the changes with code brings
  • I have made corresponding changes to the documentation ( if required )
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

More explanation

https://www.loom.com/share/05a716d61b9744faaf51fb304c21d1e5?sid=f87cf896-582a-4f76-93ae-8ceed801b145

@estelafs estelafs added the bug Something isn't working label Jan 5, 2024
@estelafs estelafs requested a review from a team January 5, 2024 19:59
@estelafs estelafs self-assigned this Jan 5, 2024
@AntoineRelief
Copy link
Collaborator

@estelafs
why is there a schema reload on application duplication?
What would trigger it?
I'm not sure it is needed

@estelafs
Copy link
Contributor Author

estelafs commented Jan 8, 2024

@AntoineRelief The schema update is triggered here: https://github.com/ReliefApplications/ems-backend/pull/915/files#diff-e4e7a68d82cdfba4e7dab9a32a8f55f3806ffa0cf33f1b8ab64b42941cf68888R86-R105, the resource field permissions update triggers it the because of the calculated fields

@AntoineRelief
Copy link
Collaborator

@AntoineRelief The schema update is triggered here: https://github.com/ReliefApplications/ems-backend/pull/915/files#diff-e4e7a68d82cdfba4e7dab9a32a8f55f3806ffa0cf33f1b8ab64b42941cf68888R86-R105, the resource field permissions update triggers it the because of the calculated fields

@estelafs
also explains why we don't see this issue in all cases, thanks!
ideally, we should not refresh the schema in such situation, as permissions on the fields should not considered as a change of the schema

@estelafs estelafs marked this pull request as draft January 9, 2024 14:06
@estelafs estelafs marked this pull request as ready for review January 9, 2024 15:07
@estelafs
Copy link
Contributor Author

estelafs commented Jan 9, 2024

@AntoineRelief I modified the PR, the schema no longer refreshes in this situation.

@RenzoPrats RenzoPrats requested review from RenzoPrats and removed request for a team January 10, 2024 21:15
Copy link
Contributor

@RenzoPrats RenzoPrats left a comment

Choose a reason for hiding this comment

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

Working fine, looks good to me!

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.

None yet

3 participants