Closed
Description
Description
With the recent deployment of Turbo on GitHub, more ajax navigation are enabled that used to be impossible. One of them is navigate from one repo to another repo (usually through notifications or profiles), which used to require a full load of the page.
Whether you like it or not is another topic, but for many Refined GitHub features, it poses a serious issue: we used to implicitly rely on a full load to reset their states across different repos, but that is not the case anymore. This results in them still using old states on a new repository and malfunctioning.
How to replicate the issue
Example: latest-tag-button appears on a different repo with no tag
Screen.Recording.2022-07-13.at.11.22.10.mov
Example: highlight-non-default-base-branch mistakenly use previous repo's default branch
Screen.Recording.2022-07-13.at.11.27.02.mov
Extension version
22.7.11
Browser(s) used
Chrome
Activity
kidonng commentedon Jul 13, 2022
Maybe we can
memthem based on repo? Example forlatest-tag-button:EDIT: the following code does not work as expected, but you got the idea
fregante commentedon Jul 13, 2022
Oof, that explains why I saw the wrong “latest tag” a few times.
This issue also affects API calls that use an empty
repository()because they’re all locally memoized and I don’t think their key ever depends on the current repo.But I don’t think the code you mentioned is affected, right? If cacheKey dynamically calls
getRepo()then it will always get the latest/correct key. The problem is where we don’t use such dynamic keyfregante commentedon Jul 20, 2022
Repro:
highlight-non-default-base-branchshowingmaineven if it's the default for the current repofregante commentedon Jul 20, 2022
I'm leaving this issue open just in case you still find broken features. I only addressed 2 very common scenarios (
repository()andgetDefaultBranch)This issue would probably cover most of the rest of the issues:
cache.functionpermanently memoizes the value of functions fregante/webext-storage-cache#34And this could be nice, but I'm not sure I'll finish it:
fregante commentedon Feb 2, 2023
This should be the last open AJAX issue 🥹
I sure there's more though, I wonder where they're hiding
methbkts commentedon Feb 5, 2023
Thanks for the fix 🥳
it was very annoying