-
Notifications
You must be signed in to change notification settings - Fork 13
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
[DAT-75] Correctly handle refreshToken for dataproxy replication #1587
Conversation
In order to ease history tracking, the failing test on the expired token message is a side effect of this previous commit where we introduced errors aggregation 5373877 |
4beba20
to
7235a26
Compare
The refreshToken detection was failing in replication, because an AggregateError is made. We now handle such situation.
c1f1fe5
to
753cad4
Compare
if (token) { | ||
token = token || data.cozyToken | ||
token = token || cozyData.cozyToken | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block can be removed, data.cozyToken
is from the appNode.dataset
you removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for the info, I was unsure of that
0f2d55c
to
1f19659
Compare
BREAKING CHANGE: The `data-cozy-token` injection is no longer supported for refreshToken. We used to rely on DOMParser to extract the new token during a refreshToken procedure. However, DOMParser is a web API, which is not available in web workers, nor in node env. Therefore, we implement our own HTML parsing, relying on the `data-cozy` attribute in HTML. We tried using external libraries such as JSDom, fauxdom or linkedom, but got build issues with all those libs. It was somehow manageable, but required some additional config in consuming apps. As the HTML parsing is quite basic, we decided that it is not worth the effort, and we now do the parsing ourselves, making it available in web, workers, and node envs. As a consequence, we do not support the `data-cozy-token` existence anymore, as it would require extra work and is seen as deprecated for several years now. If your app still somehow require it, you need to migrate the app template to rely on `data-cozy` like this: https://github.com/cozy/cozy-drive/blob/master/src/targets/browser/index.ejs#L37
1f19659
to
bf77232
Compare
`cozy-client` and `cozy-pouch-link` have been upgraded to `54.0.0` in order to retrieve a fix on the refreshToken mechanism that did not work when token expired during a Pouch replication Related PR: cozy/cozy-client#1587
`cozy-client` and `cozy-pouch-link` have been upgraded to `54.0.0` in order to retrieve a fix on the refreshToken mechanism that did not work when token expired during a Pouch replication Related PR: cozy/cozy-client#1587
`cozy-client` and `cozy-pouch-link` have been upgraded to `54.0.0` in order to retrieve a fix on the refreshToken mechanism that did not work when token expired during a Pouch replication Related PR: cozy/cozy-client#1587
`cozy-client` and `cozy-pouch-link` have been upgraded to `54.0.0` in order to retrieve a fix on the refreshToken mechanism that did not work when token expired during a Pouch replication Related PR: cozy/cozy-client#1587
`cozy-client` and `cozy-pouch-link` have been upgraded to `54.0.0` in order to retrieve a fix on the refreshToken mechanism that did not work when token expired during a Pouch replication Related PR: cozy/cozy-client#1587
`cozy-client` and `cozy-pouch-link` have been upgraded to `54.0.0` in order to retrieve a fix on the refreshToken mechanism that did not work when token expired during a Pouch replication Related PR: cozy/cozy-client#1587
This includes: