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

Support (asynchronous) cookie jars #670

Closed
4 of 6 tasks
gadicc opened this issue Sep 15, 2023 · 1 comment
Closed
4 of 6 tasks

Support (asynchronous) cookie jars #670

gadicc opened this issue Sep 15, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@gadicc
Copy link
Owner

gadicc commented Sep 15, 2023

As pointed out by @z3nful in #667 (comment), we really shouldn't need to fetch a new cookie on every new startup. This is especially an issue for serverless functions which are short-lived.

This has always been the plan; file-system and even database storage. The slightly more time consuming challenge is the initial cookie code was all programmed as synchronous calls, so it requires a little more work to change the whole flow to work asynchronously.

Leaving this open for now but anyone else is welcome to take a look too. Since we use https://www.npmjs.com/package/tough-cookie internally, we should just support any of their async cookie stores. However, we may need some async bridge code to ensure everything is set up correctly and in the correct order.

  • Make all cookie code async - 280007e
  • Ability to specify custom cookiejar with custom cookie store - b298844
  • cookie / crumb expire times
  • invalid cookie / crumb error handling?
  • Documentation
  • Tests

Bad gadicc! This should have all been in a separate branch / pull request, not separate commits. My apologies 😅

@gadicc
Copy link
Owner Author

gadicc commented Sep 18, 2023

Shippable. The missing items aren't related to this feature specifically, but in getCrumb in general, and should be addressed elsewhere.

@gadicc gadicc closed this as completed Sep 18, 2023
gadicc pushed a commit that referenced this issue Sep 18, 2023
# [2.7.0](v2.6.0...v2.7.0) (2023-09-18)

### Bug Fixes

* **chart:** belatedly promote to stable ("chart" vs "_chart") ([28ba479](28ba479))
* **deps:** update dependency @types/tough-cookie to v4.0.3 ([#673](#673)) ([625acc0](625acc0))
* **getCrumb:** rely on cookie expiry time exclusively ([178e122](178e122))
* **getCrumb:** store crumb in cookie store too ([#670](#670)) ([81031e8](81031e8))
* **getCrumb:** use logger.debug vs console.log ([bb1c06c](bb1c06c))
* **schema:** options / cookieJar ([#670](#670)) ([4d658bf](4d658bf))
* **schema:** options / cookieJar ([#670](#670)) ([f65f69c](f65f69c))
* **schema:** skip function types (not in js-schema), related fixes ([b772399](b772399))
* **schema:** update (rename _chart to chart) ([fd30770](fd30770))

### Features

* **cli:** add guidance to use CLI with submodules ([#626](#626)) ([7d08bb1](7d08bb1))
* **cli:** use a file-cookie-store ([#670](#670)) ([e2239b4](e2239b4))
* Customisable logging ([8ed81ae](8ed81ae))
* **getCrumb:** ability to specify custom cookie jar / store ([#670](#670)) ([6390a80](6390a80))
* **getCrumb:** ability to specify custom cookie jar / store ([#670](#670)) ([b298844](b298844))
gadicc pushed a commit that referenced this issue Sep 18, 2023
# [2.7.0](v2.6.0...v2.7.0) (2023-09-18)

### Bug Fixes

* **chart:** belatedly promote to stable ("chart" vs "_chart") ([28ba479](28ba479))
* **deps:** update dependency @types/tough-cookie to v4.0.3 ([#673](#673)) ([625acc0](625acc0))
* **getCrumb:** rely on cookie expiry time exclusively ([178e122](178e122))
* **getCrumb:** store crumb in cookie store too ([#670](#670)) ([81031e8](81031e8))
* **getCrumb:** use logger.debug vs console.log ([bb1c06c](bb1c06c))
* **schema:** options / cookieJar ([#670](#670)) ([4d658bf](4d658bf))
* **schema:** options / cookieJar ([#670](#670)) ([f65f69c](f65f69c))
* **schema:** skip function types (not in js-schema), related fixes ([b772399](b772399))
* **schema:** update (rename _chart to chart) ([fd30770](fd30770))

### Features

* **cli:** add guidance to use CLI with submodules ([#626](#626)) ([7d08bb1](7d08bb1))
* **cli:** use a file-cookie-store ([#670](#670)) ([e2239b4](e2239b4))
* Customisable logging ([8ed81ae](8ed81ae))
* **getCrumb:** ability to specify custom cookie jar / store ([#670](#670)) ([6390a80](6390a80))
* **getCrumb:** ability to specify custom cookie jar / store ([#670](#670)) ([b298844](b298844))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant