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

onDispose not getting called and webparts persisting between single app pages #8251

Closed
1 of 9 tasks
Greg-Hitchon opened this issue Jun 30, 2022 · 5 comments
Closed
1 of 9 tasks
Assignees
Labels
area:spfx Category: SharePoint Framework (not extensions related) status:fixed-next-drop Issue planned to be fixed in an upcoming release. type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Milestone

Comments

@Greg-Hitchon
Copy link

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version: Version 103.0.5060.66 (Official Build) (64-bit)
  • SPFx version: 1.15.0
  • Node.js version: 14.19.1
  • created from @microsoft/generator-sharepoint

Describe the bug / error

Repo here

When navigating between two app pages the webpart does not seem to be disposed properly. This occurs only after navigation from one app page to another, and not if the webparts are contained in a "normal" modern page (with sections/columns).

In the gif below I have setup 2 app pages from the repo above (which is just out of the box from the generator + alert when rendered and alert when disposed). Each app page uses the same web part 'ondispose3' with a different description ('Instance 1', 'Instance 2').

When navigating between these using site navigation it seems onDispose is not being called. This leaves the render still happening even in a page like "Documents".

Works: 'Documents' -> 'App Page 1' -> 'Documents' -> 'App Page 2' -> 'Documents'
Does not work: 'Documents' -> 'App Page 1' -> 'App Page 2' -> 'Documents' ('App Page 1' still seems to be trying to render)

spfx-dispose-bug

#6246 #6786 and #5227 all seemed somewhat related but do not seem to be directly applicable/solve the issue.

Steps to reproduce

  1. Clone/build the repo, or create a new webpart from yo generator and add alert/console.log on render and on dispose
  2. Add 2 new app pages with the webpart
  3. Change the description to be unique for each
  4. Add links to the pages in site navigation
  5. Navigate between each like 'Documents' -> 'App Page 1' -> 'App Page 2' -> 'Documents'

Expected behavior

Webparts in the app pages should be disposed correctly between navigation and scenarios like: 'Documents' -> 'App Page 1' -> 'App Page 2' -> 'Documents' should not cause additional renders.

@Greg-Hitchon Greg-Hitchon added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label Jun 30, 2022
@ghost
Copy link

ghost commented Jun 30, 2022

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 Awaiting categorization and initial review. label Jun 30, 2022
@AJIXuMuK AJIXuMuK added area:spfx Category: SharePoint Framework (not extensions related) and removed Needs: Triage 🔍 Awaiting categorization and initial review. labels Jun 30, 2022
@AJIXuMuK AJIXuMuK self-assigned this Jul 8, 2022
@Greg-Hitchon
Copy link
Author

Hello @AJIXuMuK...If you have had a chance to take a look at this could you let me know if this is indeed a bug or perhaps an unsupported scenario/something I am doing incorrectly?

@AJIXuMuK
Copy link
Collaborator

Hello @Greg-Hitchon - yes, the issue has been fixed internally and will be rolling out WW during the next couple of weeks.

@AJIXuMuK AJIXuMuK added the status:fixed-next-drop Issue planned to be fixed in an upcoming release. label Jul 12, 2022
@AJIXuMuK AJIXuMuK added this to the 07-08 milestone Jul 12, 2022
@AJIXuMuK
Copy link
Collaborator

This should be rolled out WW by now.

@ghost
Copy link

ghost commented Jul 27, 2022

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

@ghost ghost locked as resolved and limited conversation to collaborators Jul 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:spfx Category: SharePoint Framework (not extensions related) status:fixed-next-drop Issue planned to be fixed in an upcoming release. type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Projects
None yet
Development

No branches or pull requests

2 participants