Skip to content

chore(offline_first_with_supabase): Catching AuthRetryableFetchException to ignore it on any action that does not have the remote policy#615

Merged
tshedor merged 1 commit intoGetDutchie:mainfrom
stefanorumi7:feature/auth_retryable_fetch_exception_ignored
Jul 2, 2025
Merged

chore(offline_first_with_supabase): Catching AuthRetryableFetchException to ignore it on any action that does not have the remote policy#615
tshedor merged 1 commit intoGetDutchie:mainfrom
stefanorumi7:feature/auth_retryable_fetch_exception_ignored

Conversation

@stefanorumi7
Copy link
Contributor

Solution to issue #607 . Solving the following exception in OfflineFirst Supabase repositories:

I/flutter (18709): │ AuthRetryableFetchException(message: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = 127.0.0.1, port = 35506, uri=http://127.0.0.1:54321/auth/v1/token?grant_type=refresh_token, statusCode: null)

OfflineFirstDeletePolicy policy = OfflineFirstDeletePolicy.optimisticLocal,
Query? query,
}) async {
Exception? caughtException;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh I'd rather be anti-DRY than make an extra assignment. Could you please throw instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to the more straightforward (less DRY) code.

PostgresChangeFilter? queryToPostgresChangeFilter<TModel extends TRepositoryModel>(
Query query,
) {
PostgresChangeFilter? queryToPostgresChangeFilter<TModel extends TRepositoryModel>(Query query) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My personal IDE is also set to 100 line length, but pub.dev grades you on having their formatting. So you'll need to format this file at an 80 character line length.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was hard to keep the previous formatted, my VS was chosing a different formatting style when set to 80 so almost every 2 lines I had a change. I formatted it by hand.
Do you have any formatting configuration you could share? (besides the one in .vscode already)

OfflineFirstUpsertPolicy policy = OfflineFirstUpsertPolicy.optimisticLocal,
Query? query,
}) async {
Exception? caughtException;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@stefanorumi7 stefanorumi7 force-pushed the feature/auth_retryable_fetch_exception_ignored branch from 8f2065b to fba4e52 Compare July 2, 2025 08:25
…ion to ignore it on any action that does not have the remote policy
@stefanorumi7 stefanorumi7 force-pushed the feature/auth_retryable_fetch_exception_ignored branch from fba4e52 to 9e948e7 Compare July 2, 2025 08:29
@tshedor tshedor merged commit 386a693 into GetDutchie:main Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants