pubkey / rxdb

A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/

Home Page:https://rxdb.info/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GraphQL Replication error missing information

phal0r opened this issue · comments

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?

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

commented

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

Still relevant. We will create a MR

commented

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.