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

feat: Correctly handle error screens when the app is offline and allow to open cozy-apps when offline in iOS #1238

Open
wants to merge 5 commits into
base: feat/files_offline
Choose a base branch
from

Conversation

Ldoppea
Copy link
Member

@Ldoppea Ldoppea commented Aug 26, 2024

NetStatusBoundary is used to display an offline error screen when
the app is offline

Now that we implemented offline mode, we now want to disable the
NetStatusBoundary for cozy-apps as they should now be accessible when
offline

NetStatusBoundary is kept only on onboarding screens

__

In iOS, we disabled HttpServer for all cozy-apps as the WebView API may
behave differently

The side effect is that we cannot open those app when offline as we
cannot inject minimal code to make them work without network access

So we want to enable HttpServer on those apps when we detect the app to
be offline

Related PR: #486

`NetStatusBoundary` is used to display an `offline` error screen when
the app is offline

Now that we implemented offline mode, we now want to disable the
`NetStatusBoundary` for cozy-apps as they should now be accessible when
offline

`NetStatusBoundary` is kept only on onboarding screens
In a previous commit we changed the return type for
`getIndexHtmlForSlug()`

We did not change the return objects for every execution paths

This commit fixes that
For now offline mode has only been implemented in cozy-home and
mespapiers apps

This commit prevents other cozy-apps to be opened offline

Later we will declare offline support in cozy-apps' manifests, so this
hard coded condition is meant to be replaced in the future
Cozy-apps can be opened offline only when they support this mode but
also when they have been opened at least one time to retrieve necessary
data to make them run offline

When those conditions are not met, we want to display an error message
to explain the user why the app cannot be opened

For now this message is in an Alert form, but later we may want to
improve the UI for this part
In iOS, we disabled HttpServer for all cozy-apps as the WebView API may
behave differently

The side effect is that we cannot open those app when offline as we
cannot inject minimal code to make them work without network access

So we want to enable HttpServer on those apps when we detect the app to
be offline

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

Successfully merging this pull request may close these issues.

2 participants