-
Notifications
You must be signed in to change notification settings - Fork 131
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
Introduce chrome cache #959
Introduce chrome cache #959
Conversation
5508479
to
63a7547
Compare
Codecov Report
@@ Coverage Diff @@
## master #959 +/- ##
==========================================
+ Coverage 51.12% 52.69% +1.56%
==========================================
Files 56 57 +1
Lines 1021 1057 +36
Branches 200 204 +4
==========================================
+ Hits 522 557 +35
- Misses 396 397 +1
Partials 103 103
|
export async function loadNav(yamlConfig) { | ||
const groupedNav = await getNavFromConfig(safeLoad(yamlConfig)); | ||
export async function loadNav(yamlConfig, cache) { | ||
let groupedNav = await cache.getItem('navigation'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@karelhala when is this cache supposed to be populated? I see this undefined on each page refresh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Hyperkid123 mhh, that is strange. It should be populated from entry.js
I checked it locally and it looks populated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What key is supposed to be stored in localSotarge
? I have it stored under chrome:global-filter/chrome
. I don't see anything stored under key with navigation
string. Is it possible that your code might be using stale storage? Can you try and clear it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing, tried clearing cache and it still works, you should be able to find it under ${session}-chrome/chrome
where expires is set and in data
you should see navigation. I don't want to polute localStorage
more than we did so I think we could use one localForge store for all chrome related non API data. I'd like to add global filter values to it once we agree on the shape of it and such.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I have in local storage
chrome:global-filter/6e9e3e69-7364-4bbc-94c6-45e2f5ffe7c6: "{}"
chrome:global-filter/chrome: "{"data":{"navigation":{"ansible":{"title":"Red Hat Ansible Automation Platform","id":"ansible","routes":[{"tit
If I log the cache name from the nav should be extracted its chrome:global-filter/6e9e3e69-7364-4bbc-94c6-45e2f5ffe7c6
which is empty object in my local storage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@karelhala ok it works now. I had to logout and login to make it work. 🤷 possible bug? The key selection seems "unreliable"
63a7547
to
7454d8e
Compare
7454d8e
to
b43510c
Compare
No description provided.