mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
Migrate old style tokens to new style because element-web doesn't soft-logoout on 4xx errors on /sync
This commit is contained in:
parent
31f1810814
commit
842887982c
|
|
@ -142,7 +142,7 @@ func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request, device *userapi.
|
|||
if err != nil {
|
||||
if err == types.ErrMalformedSyncToken {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusUnauthorized,
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: jsonerror.InvalidArgumentValue(err.Error()),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -273,6 +273,9 @@ func NewStreamTokenFromString(tok string) (token StreamingToken, err error) {
|
|||
err = ErrMalformedSyncToken
|
||||
return
|
||||
}
|
||||
// Migration: Remove everything after and including '.' - we previously had tokens like:
|
||||
// s478_0_0_0_0_13.dl-0-2 but we have now removed partitioned stream positions
|
||||
tok = strings.Split(tok, ".")[0]
|
||||
parts := strings.Split(tok[1:], "_")
|
||||
var positions [7]StreamPosition
|
||||
for i, p := range parts {
|
||||
|
|
|
|||
Loading…
Reference in a new issue