dcaslin / d2-checklist

Source for www.d2checklist.com, written in Angular and using the Bungie API
https://www.d2checklist.com/
MIT License
91 stars 24 forks source link

Possible bug with persisting selected filters on todo-list page. #356

Closed GeekyEggo closed 2 years ago

GeekyEggo commented 3 years ago

Prefix

Thank you - d2checklist has saved me, and I'm sure many others, a lot of time. Your efforts are truly appreciated!

Suggestion

I have noticed intermittently that selected filters do not persist between page refreshes / returning visit. Is there any expected behaviour that may result in these settings being lost? Are there any additional console logs I would be able to add that might provide more insight into why the filters weren't persisted?

dcaslin commented 3 years ago

Interesting. Yeah if you can share anything that gets dumped to console (if anything) when it fails and/or anything under "D2STATE-FILTERS" in your local storage. Thanks!

image

GeekyEggo commented 3 years ago

Interestingly D2STATE-FILTERS-rewards shows true for everything, however only pinnacles are visible as "Active Reward Filters".

{
   "Powerful Gear (Tier 3)":true,
   "Powerful Gear (Tier 2)":true,
   "Powerful Gear (Tier 1)":true,
   "Legendary Gear":true,
   "Bright Dust":true,
   "XP":true,
   "Glimmer":true,
   "Infamy Rank Points":true,
   "Valor Rank Points":true,
   "Dawning Spirit":true,
   "Hymn of Desecration":true,
   "Trials Engram":true,
   "Phantasmal Core":true,
   "Upgrade Module":true,
   "Enhancement Core":true,
   "Mod Components":true,
   "Firewall Data Fragment":true,
   "Phantasmal Fragment":true,
   "Essence of Dawning":true,
   "Perfect Taste":true,
   "Sharp Flavor":true,
   "Dark Ether Cane":true,
   "Taken Butter":true,
   "Crucible Token":true,
   "Trials Token":true,
   "Spinmetal Leaves":true,
   "Dusklight Shard":true,
   "Etheric Spiral":true,
   "Iron Banner Token":true,
   "Microphasic Datalattice":true,
   "Helium Filaments":true,
   "Vanguard Tactician Token":true
}

image

And here's a log dump:

main.93da5538881e81149e1f.js:1 Loading cache
main.93da5538881e81149e1f.js:1 ------PwaService-------
main.93da5538881e81149e1f.js:1 Service worker is enabled
main.93da5538881e81149e1f.js:1 App is stable: false
main.93da5538881e81149e1f.js:1 BeforeInstallPromptEvent {isTrusted: true, platforms: Array(1), userChoice: Promise, type: "beforeinstallprompt", target: Window, …}
main.93da5538881e81149e1f.js:1 825.8400000013353 ms to load manifest
main.93da5538881e81149e1f.js:1 No preferred platform using: 2
main.93da5538881e81149e1f.js:1 Object
main.93da5538881e81149e1f.js:1 Object
main.93da5538881e81149e1f.js:1 Object
main.93da5538881e81149e1f.js:1 Object
main.93da5538881e81149e1f.js:1 Object
main.93da5538881e81149e1f.js:1 Object
main.93da5538881e81149e1f.js:1 Object
main.93da5538881e81149e1f.js:1 Object
main.93da5538881e81149e1f.js:1 Object
main.93da5538881e81149e1f.js:1 Object
main.93da5538881e81149e1f.js:1 Object
7.32defd147a96b1687f29.js:1 That's weird! couldn't find filter for Powerful Gear
7.32defd147a96b1687f29.js:1 That's weird! couldn't find filter for Powerful Gear
main.93da5538881e81149e1f.js:1 App is stable: true
main.93da5538881e81149e1f.js:1 Checking for update...
dcaslin commented 3 years ago

Thanks! Have you noticed any patterns to which filters to it? Can you share a screenshot of those filters? Haven't been able to reproduce so far in limited testing

GeekyEggo commented 3 years ago

I'm having trouble replicating it reliable, however from my observations I did notice:

  1. Each time I toggle a filter That's weird! couldn't find filter for Powerful Gear is logged.
  2. If I toggle "View: Compact/ Normal", the filters seem to persist.

https://user-images.githubusercontent.com/1429781/103385960-952a8700-4af4-11eb-832b-dcbfdf6d3427.mp4

deangaudet commented 3 years ago

i encounter the same/similar issue. i have a set of hidden activities, and ignore rewards, which in particular includes trials. however it seems like every week when trials starts up again, i have to re-add the trials hides/ignores. is it possible that it's losing them in the interim, like when those bounties aren't in-game between tue-thu? the other settings seem to stay around (or i just haven't noticed).

i already re-added the trials ignores for this week, but i'll try to pay more attention to exact details next time i see this repro.

types:

/common/destiny2_content/icons/00ba01ddecfc4e8fdaf97e9c9b51ca56.jpg: true
/common/destiny2_content/icons/3be4e28391c8ba1ee29c41ef67e5f509.jpg: true
/common/destiny2_content/icons/4d8ed3fbdedc9a4773942749b8074bdd.png: true
/common/destiny2_content/icons/8e2b788e489d8729942d05af786979b4.jpg: true
/common/destiny2_content/icons/29b8d39513cc72057deab177f10cb2fb.png: true
/common/destiny2_content/icons/34d7398f595e47d0ab1271cea1712906.jpg: true
/common/destiny2_content/icons/46e232c1f32d9bc1a92ce80d2056bb76.jpg: true
/common/destiny2_content/icons/96fdb2fead871ba72009983930da5d43.jpg: true
/common/destiny2_content/icons/404dc0f589ebf6b13475e2698f7320d4.jpg: true
/common/destiny2_content/icons/903a6272fe166bfa11260b8d94da3f7c.png: true
/common/destiny2_content/icons/6727afd9160f24b1a42a77ef0e8f5e84.jpg: true
/common/destiny2_content/icons/5220840acbfbe9ef17628bf7df749cc0.jpg: true
/common/destiny2_content/icons/DestinyMilestoneDefinition_6e3e2457fd1f7a9df5c491213bcaf133.png: true
/common/destiny2_content/icons/DestinyMilestoneDefinition_42c55bbbfc5395f21659a899e3eca488.png: true
/common/destiny2_content/icons/a3720787da05d34cfe2ed30ec76781b9.jpg: true
/common/destiny2_content/icons/b02b84e322e698d553ea95801cbbfb2f.jpg: true
/common/destiny2_content/icons/cb56223fe0f1a3a709674ef55a751537.png: true
/common/destiny2_content/icons/f4fc02a85039961f836af9a8cde185b2.jpg: true

rewards:

Dusklight Shard: true
Etheric Spiral: true
Firewall Data Fragment: true
Glimmer: true
Helium Filaments: true
Hymn of Desecration: true
Infamy Rank Points: true
Microphasic Datalattice: true
Mod Components: true
Phantasmal Core: true
Phantasmal Fragment: true
Spinmetal Leaves: true
Trials Engram: true
Trials Token: true
Valor Rank Points: true
XP: true
dcaslin commented 3 years ago

Ah this is great info! Yes that's very possible. So is it specifically trials that's getting lost as the ignore activity? Everything else works properly?

(This is the one part of D2Checklist that I didn't personally build, it was contributed by @asherbig so I'll have to do a bit more learning on that).

deangaudet commented 3 years ago

yep for me it's trials i keep having to re-hide... and i think it corresponds to showing up again every friday. i'll pay more attention next week. i'm guessing a dump of the variables after reset on tuesday would be useful too.

asherbig commented 3 years ago

Ah, yeah, that was something i started to notice too. Any time the filters change, the new list is stored to local storage. That save also happens when the page loads, which usually doesn't do anything because it loads to your regular saved filters. Trials actually gets removed and re-added every week, so the cache will initialize correctly from your previous filters, but then the old stuff that isn't in the newest info from bungie isn't there so it's lost. Then when trials comes back, your old preference is also lost.

I think the solution would be to do a check if an activity or reward is missing from the bungie response, and if it is then don't remove it. Right now it does a much simpler delete all and replace all.

deangaudet commented 3 years ago

yep just confirming that it was after trials came back this week that i started seeing the trials activities again, and have to re-hide them.