Skip to content
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

fix!: makes changes to the session recipe functions #340

Merged
merged 3 commits into from
Jun 30, 2022

Conversation

rishabhpoddar
Copy link
Contributor

Summary of change

Makes changes to the session recipe for not throwing unauthorised error from functions that accept a session handle / access token and may not be working with the current session.

Related issues

Test Plan

TODO

Documentation changes

(If relevant, please create a PR in our docs repo, or create a checklist here highlighting the necessary changes)

Checklist for important updates

  • Changelog has been updated
  • coreDriverInterfaceSupported.json file has been updated (if needed)
    • Along with the associated array in lib/ts/version.ts
  • frontendDriverInterfaceSupported.json file has been updated (if needed)
  • Changes to the version if needed
    • In package.json
    • In package-lock.json
    • In lib/ts/version.ts
  • Had run npm run build-pretty
  • Had installed and ran the pre-commit hook
  • Issue this PR against the latest non released version branch.
    • To know which one it is, run find the latest released tag (git tag) in the format vX.Y.Z, and then find the latest branch (git branch --all) whose X.Y is greater than the latest released tag.
    • If no such branch exists, then create one from the latest released branch.
  • If have added a new web framework, update the add-ts-no-check.js file to include that
  • If added a new recipe / api interface, then make sure that the implementation of it uses NON arrow functions only (like someFunc: function () {..}).
  • If added a new recipe, then make sure to expose it inside the recipe folder present in the root of this repo. We also need to expose its types.

Remaining TODOs for this PR

  • Tests

@rishabhpoddar rishabhpoddar changed the title makes changes to the session recipe functions fix!: makes changes to the session recipe functions Jun 28, 2022
@rishabhpoddar rishabhpoddar marked this pull request as ready for review June 29, 2022 05:54
@rishabhpoddar rishabhpoddar requested a review from porcellus June 29, 2022 05:55
@porcellus
Copy link
Collaborator

This isn't really an issue, but I don't think this fits the "fix" in the PR title it's more of an interface change than a bugfix.

@rishabhpoddar
Copy link
Contributor Author

This isn't really an issue, but I don't think this fits the "fix" in the PR title it's more of an interface change than a bugfix.

Well, actually this issue was discovered cause an issue which I would call a bug in design -> when looping through all sessions of a user, and whilst looping, if one of them expires (edge case, but it happened!), and then if the updateAccessTokenPayload was called on that session handle, it would throw an unauthorised error, logging out the current session.

@rishabhpoddar rishabhpoddar requested a review from porcellus June 30, 2022 14:28
@rishabhpoddar rishabhpoddar merged commit 47d953d into next-breaking-change Jun 30, 2022
@rishabhpoddar rishabhpoddar deleted the session-error-throwing-fix branch June 30, 2022 16:59
rishabhpoddar added a commit that referenced this pull request Jul 5, 2022
* fix!: makes changes to the session recipe functions (#340)

* makes changes to the session recipe

* fixes tests

* cleans up error throwing in sessionCLass

* fixes issue #343 (#344)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants