User datasets can be installed in the database at any point of a user's website session. Since we don't have a dedicated way to detect such events, this PR introduces a way to break the memoization cache such that we always request updated permissions from the backend. I opted not to remove the memoization itself with the thought that we might be able to leverage the WDK user service client module in some way to detect installed user datasets, and once again take advantage of memoization. A more robust fix might be to use a different approach to prevent multiple calls to the permissions endpoint, or to simply remove memoization. Since this is a somewhat urgent issue, I opted for a solution that introduces the least change. I will open an issue to explore this in a more robust way.
Fixes #21.
User datasets can be installed in the database at any point of a user's website session. Since we don't have a dedicated way to detect such events, this PR introduces a way to break the memoization cache such that we always request updated permissions from the backend. I opted not to remove the memoization itself with the thought that we might be able to leverage the WDK user service client module in some way to detect installed user datasets, and once again take advantage of memoization. A more robust fix might be to use a different approach to prevent multiple calls to the permissions endpoint, or to simply remove memoization. Since this is a somewhat urgent issue, I opted for a solution that introduces the least change. I will open an issue to explore this in a more robust way.