- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.6k
fix: refactor request token handling and do not update with invalid result #53326
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
Conversation
| Best to review commit by commit - most changes are tests only. | 
| /backport to stable31 | 
| /backport to stable30 | 
76ab7d3    to
    8193a42      
    Compare
  
    Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
…n reading order Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
| /compile | 
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.
🐘
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
| Thank you for this! The linked bug has been present for years, I really hope this is the end of it. | 
| * Get interval in seconds | ||
| */ | ||
| function getInterval(): number { | ||
| const interval = seesionLifetime | 
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.
Oups 
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.
seeeesion
Summary
Originally this should have been only a refactoring to migrate the code to Typescript and add some more tests for it.
But doing so I discovered some issues within the logic that revealed to cause the linked issue (or to cause at least the frontend part of it).
The issue itself if likely to be orginally caused by some server issue (e.g. overloaded) which causes a 500 return, then we have an "undefined" token (as the old code did not check for the validity) and tried to update it.
This causes all following requests to use an invalid token.
Checklist