[MGNLUI-8153] Page Editor does not reload after editing a component Created: 29/Jun/23 Updated: 17/Aug/23 Resolved: 24/Jul/23 |
|
| Status: | Closed |
| Project: | Magnolia UI |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.3.0 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Christopher Zimmermann | Assignee: | Rishab Dhar |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
| Σ Time Spent: | 6h 50m | Time Spent: | 2h 50m |
| Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
| Sub-Tasks: |
|
|||||||||||||||||||||||||
| Template: | ||||||||||||||||||||||||||
| Acceptance criteria: |
Empty
|
|||||||||||||||||||||||||
| Task DoD: |
[X]*
Doc/release notes changes? Comment present?
[X]*
Downstream builds green?
[X]*
Solution information and context easily available?
[X]*
Tests
[X]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
|||||||||||||||||||||||||
| Bug DoR: |
[X]*
Steps to reproduce, expected, and actual results filled
[X]*
Affected version filled
|
|||||||||||||||||||||||||
| Epic Link: | SPA Editor Backlog | |||||||||||||||||||||||||
| Sprint: | DevX 42 | |||||||||||||||||||||||||
| Story Points: | 1 | |||||||||||||||||||||||||
| Team: | ||||||||||||||||||||||||||
| Work Started: | ||||||||||||||||||||||||||
| Approved: |
Yes
|
| Description |
|
On SaaS (It works on DXCORE with react-minimal project), For example on the “Hello-SaaS-Tutorial” project. (but also on other projects) When you go to a page from the browser, the first time that you EDIT a component, the Page editor does not auto-reload and so you do not see the change that has been made. The second time you edit the component (in the dialog you see that the change WAS MADE), and save the component, then the page reloads and the page shows the edit. Note - The Delete and Add component actions work propertly - the page always reloads. NOTES Please sync with Nucleus team as this relates to a module in their domain. Please do some research into why the code is as-it-is, possibly the bug was introduced trying to solve some specific case, and we don't want to break that.
Developer notes The PageEditorPresenter refreshes the editor if the DatasourceObservation is triggered AND if the locale hasn't changed. But for some reason, the locale is set to "en" when the page is opened, but opening the component dialogs re-sets it to "en_US". Since i18n is only partially implemented in norsu, a quick fix would be to return MagnoliaContext.getLocale in i18nAuthoringSupport (just as the Javadoc says) instead of Locale.getDefault which reads it directly from JVM. But because this code is shared by both JCR and norsu, we should verify that it doesn't break anything else.
Reproducing the ErrorThe error is occuring on several projects that are using Next.JS SSG with "Preview mode". One project is the "Recommender" project on the "PM Norsu" instance. To Reproduce:
|