Posted on 02/05/2024 10:25:09
Hi Kevin,
In this case, the addin is actually being unloaded successfully, however it's the page caching that is causing the issue you're seeing. Once you've set the title of the page, it will stay like that regardless of the addin existing or not, you can test and verify this by setting it to a new Guid instead;
[Subscribe("DWN_STANDARD_PAGE_LOADED")]
public class PageLoaded : NotificationSubscriber
{
public override void OnNotify(string notification, NotificationArgs args) => ((Standard.Page.LoadedArgs) args).PageViewInstance.Page.MetaTitle = Guid.NewGuid().ToString();
}
You would then see the following;
Install addin
1st load, original page title - after the page is loaded, the notification is made and the title is updated, but this is after the page is loaded.
2nd load, "d547f6c9-0fd7-49cd-9e4f-9d13a2b6cbae" - the page now has the guid it generated from the previous load, and it now generates a new one for the next load.
3rd load, "192a7564-7ca9-4090-8a72-800dc9a9fdf4" - same as above, but keep in mind that the pages actual title is different from what it was loaded in with.
Uninstall addin
4th load, "70392159-281a-4607-9e66-0101f036a8fc" - this is the new guid it got from the previous notification, but since there's no longer any notification subscriber setting the metaTitle, it will stay like this.
5th load and onward "70392159-281a-4607-9e66-0101f036a8fc" - same guid as above, as no new ones are generated.
I hope it makes sense - in general the pageView wouldn't really be modified like this and I get the point of this is getting to know and understand the addins etc, this is the reason for the behaviour you're seeing.