pubkey / rxdb

A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/
https://rxdb.info/
Apache License 2.0
20.96k stars 1.02k forks source link

GraphQL Replication error missing information #5952

Open phal0r opened 2 months ago

phal0r commented 2 months ago

If the GraphQL server returns an error in the errors json response, it usually includes a code (most of the time a string like AUTHENTICATION_ERROR) in the extensions object. The extensions object is a place to also add other arbitrary information according to the spec.

Starting with RxDB 14 errors seem to be normalized and the graphql replication will just throw an error with the errors array as seen here: https://github.com/pubkey/rxdb/blob/master/src/plugins/replication-graphql/index.ts#L167

The normalized errors do not contain the extensions object anymore, which in our case breaks token refresh, because we cannot detect the proper error code anymore.

Is this behaviour intentional or a bug?

pubkey commented 2 months ago

This is not intentional. If any information is missing in the thrown error, we can add it. Please make a PR.

stale[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. Please update it or it may be closed to keep our repository organized. The best way is to add some more information or make a pull request with a test case. Also you might get help in fixing it at the RxDB Community Chat

phal0r commented 2 months ago

Still relevant. We will create a MR

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. Please update it or it may be closed to keep our repository organized. The best way is to add some more information or make a pull request with a test case. Also you might get help in fixing it at the RxDB Community Chat If you know you will continue working on this, just write any message to the issue (like "ping") to remove the stale tag.