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(Workspace): Clear bootinfo cache when creating a new workspace #21895

Merged

Conversation

cogk
Copy link
Contributor

@cogk cogk commented Aug 1, 2023

Description

Just after creating a new Workspace, it suddenly seemed to not exist when reloading the page.

Indeed, available workspaces are not fetched directly from the database, but instead are found, when reloading, in bootinfo : frappe.boot.allowed_workspaces. However, because of a missing cache invalidation of bootinfo for the user, it becomes out-of-sync with the actual Workspaces, because the bootinfo is cached.

A partial fix (e4c45dd) was recently merged, but it is more of a workaround, using localStorage.

Solution

Clear the bootinfo cache for the user when creating a private Workspace. (Could also do it when deleting/updating one?)

Drawbacks

I'm not sure if I should add some conditions like if frappe.flags.in_install:, I'm open to suggestions

@cogk cogk requested review from a team and maharshivpatel and removed request for a team August 1, 2023 17:19
@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label Aug 1, 2023
@cogk cogk force-pushed the fix-clear-bootinfo-cache-on-workspace-creation branch from 0871311 to 881240e Compare August 4, 2023 15:49
@codecov
Copy link

codecov bot commented Aug 4, 2023

Codecov Report

Merging #21895 (881240e) into develop (dc0a8c5) will increase coverage by 0.00%.
Report is 3 commits behind head on develop.
The diff coverage is 75.00%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #21895   +/-   ##
========================================
  Coverage    61.81%   61.81%           
========================================
  Files          765      765           
  Lines        72996    73004    +8     
  Branches      6292     6292           
========================================
+ Hits         45123    45130    +7     
- Misses       24309    24310    +1     
  Partials      3564     3564           
Flag Coverage Δ
server 65.24% <75.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@ankush ankush merged commit 9b52718 into frappe:develop Aug 8, 2023
18 of 19 checks passed
@ankush ankush added backport version-14-hotfix backport to version 14 and removed add-test-cases Add test case to validate fix or enhancement labels Aug 8, 2023
ankush added a commit that referenced this pull request Aug 8, 2023
…ackport #21895) (#21964)

* fix(Workspace): Clear bootinfo cache when creating a new workspace

(cherry picked from commit 881240e)

* chore: conflicts

---------

Co-authored-by: Corentin Forler <10946971+cogk@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
frappe-pr-bot pushed a commit that referenced this pull request Aug 9, 2023
# [14.44.0](v14.43.1...v14.44.0) (2023-08-09)

### Bug Fixes

* added debounce for checking old and new password same or not ([76c6594](76c6594))
* added validation of (if old password === new password) ([f7a2c36](f7a2c36))
* allow cross child table links in dashboard ([d29b151](d29b151))
* autoincr status per doctype ([#21918](#21918)) ([#21920](#21920)) ([1fda93a](1fda93a))
* better UX ([ec7b78e](ec7b78e))
* center notes text in FileUploader ([#21902](#21902)) ([30e236c](30e236c))
* check before deleting prepared report ([#21950](#21950)) ([#21952](#21952)) ([41c7cd7](41c7cd7))
* check file permission before zipping ([#21934](#21934)) ([#21941](#21941)) ([ec71e07](ec71e07))
* debounce form refresh from realtime events ([#21905](#21905)) ([#21907](#21907)) ([5b221bf](5b221bf))
* Delete module folder on Module Def deletion ([#21857](#21857)) ([#21914](#21914)) ([4f29f39](4f29f39))
* disable activity log global search ([306b1b1](306b1b1))
* **DX:** Wrap print format errors (backport [#21944](#21944)) ([#21945](#21945)) ([0e56bfa](0e56bfa))
* fixed on click function ([6fc0439](6fc0439))
* grid don't remove search if filters are applied. ([c138e66](c138e66))
* ignore_user_type can be applied by System User (backport [#21990](#21990)) ([#21991](#21991)) ([66556d2](66556d2))
* include server script in recorder stack trace ([#21891](#21891)) ([af3dbbf](af3dbbf))
* keep privacy setting of attachments on amend ([#21911](#21911)) ([#21912](#21912)) ([1f586b2](1f586b2))
* Made Set Password Page Better ([91c112f](91c112f))
* only allow system manager to start backups ([7d0e4f1](7d0e4f1))
* support timespan filters for custom dashboard chart source ([67cf5c6](67cf5c6))
* update time_series on refresh, but not for custom chart_type ([2da5482](2da5482))
* validate fieldname in get_group_by_count ([#21932](#21932)) ([#21943](#21943)) ([a1c18a6](a1c18a6))
* validate type in share.get_users ([#21931](#21931)) ([5b42259](5b42259))
* workflow help ([482f004](482f004))
* **Workspace:** Clear bootinfo cache when creating a new workspace (backport [#21895](#21895)) ([#21964](#21964)) ([ba775ed](ba775ed))

### Features

* german translations for printed filters ([2443bf0](2443bf0))
* print all filters in report builder ([83b6fd2](83b6fd2))

### Performance Improvements

* **customize_form:** rebuild global search in bg ([dfbf859](dfbf859))
* lower limit for global search ([1b43c2d](1b43c2d))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants