Skip to content
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

Offline mode didn't work during Bungie.net maintenance #10808

Closed
Revadike opened this issue Nov 20, 2024 · 10 comments
Closed

Offline mode didn't work during Bungie.net maintenance #10808

Revadike opened this issue Nov 20, 2024 · 10 comments
Labels

Comments

@Revadike
Copy link
Contributor

Proposed change

Instead of showing an error when the Bungie API or your internet is down, have DIM work with limited functionality based on cached data.

How does this fit into your workflow?

I'll be able to organize my notes, edit my loadouts, view my rolls, while destiny is down for maintenance.

@bhollis
Copy link
Contributor

bhollis commented Nov 21, 2024

This is already a feature of DIM, so this isn't a feature request. I've documented DIM's offline mode here: https://github.com/DestinyItemManager/DIM/wiki/Offline-Mode

I think you're trying to report that DIM's offline mode doesn't work correctly, which is a bug.

I did address this somewhat in the new documentation:

Lastly, DIM can fail to work when Bungie.net is not entirely down, but instead is responding to requests in some broken way. DIM is designed to handle Bungie.net's regular maintenance periods, but sometimes Bungie.net is broken in some interesting new way that DIM's code cannot anticipate, which means it doesn't fall back to offline mode. These situations are generally rare, and it's tough for the DIM team to predict them, or handle them afterwards since once Bungie.net is back, there are often no good records of the weird behavior during the outage.

The way we test offline mode is to disconnect internet (e.g. turn off wifi) and then reload DIM. It should come up and allow viewing and editing tags and loadouts, etc. Let me know if that doesn't work for you. For cases where Bungie.net is really messed up, see the quote above.

@bhollis bhollis changed the title Offline functionality: Cached inventory and loadout management Offline mode didn't work during Bungie.net maintenance Nov 21, 2024
@bhollis
Copy link
Contributor

bhollis commented Nov 25, 2024

Just checking in - were you able to test that offline mode works correctly with your internet connection disabled?

@Revadike
Copy link
Contributor Author

How do you want me to test that? I can't load the page when internet is down and if its already loaded what's there to test?

@bhollis
Copy link
Contributor

bhollis commented Nov 25, 2024

The way we test offline mode is to disconnect internet (e.g. turn off wifi) and then reload DIM.

@bhollis
Copy link
Contributor

bhollis commented Nov 27, 2024

Interesting - that suggests that you haven't successfully installed the service worker from a previous visit, or that you have your browser configured not to keep cached data. Is that right? If you visit about:debugging#/runtime/this-firefox you should see a service worker registered for app.destinyitemmanager.com or beta.destinyitemmanager.com.

@Revadike
Copy link
Contributor Author

It's installed

@bhollis
Copy link
Contributor

bhollis commented Nov 27, 2024

You should be seeing DIM then, served from cache, not a failure to load. The service worker and its cache is what allows DIM to be served offline. I'm not sure why your browser isn't working the way it's supposed to.

Separately, in testing on Firefox on my machine, DIM does load from the service worker, but then fails to load the Bungie.net manifest with an error from IndexedDB:

The operation failed for reasons unrelated to the database itself and not covered by any other error code

IndexedDB works when connected to the internet, but not when offline. This kinda defeats the purpose of having an offline database.

Honestly, I'd recommend switching to a Chromium-based browser like Vivaldi. Firefox has a lot of bugs around this stuff.

@bhollis
Copy link
Contributor

bhollis commented Nov 27, 2024

OK, the IDB error is happening whether or not we're online and is unrelated to this issue - it's related to #10764, yet another Firefox bug related to storing large objects in IDB. The fix for that is going to have to happen separately.

@Revadike
Copy link
Contributor Author

I tested incorrectly, I put the browser in offline mode via web tools. I was streaming and didn't want to disconnect from internet. Turns out offline mode won’t work with service workers, it works as you described when I disconnect from the internet.

@bhollis
Copy link
Contributor

bhollis commented Nov 27, 2024

Interesting. Even Firefox's "Work Offline" mode seems to work, but I guess their devtools offline emulation doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants