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

Bugfix: Make additional capabitities optional #55

Merged
merged 2 commits into from
Aug 25, 2022
Merged

Bugfix: Make additional capabitities optional #55

merged 2 commits into from
Aug 25, 2022

Conversation

kevindkeogh
Copy link

The spec indicates that all capabilities except urn:ietf:params:jmap:core are optional. This commit ensures that when a session is coerced from JSON to a Session object, it doesn't throw an error when the response doesn't include optional capabilities.

The spec indicates that all capabilities except `urn:ietf:params:jmap:core`
are optional. This commit ensures that when a session is coerced from
JSON to a Session object, it doesn't throw an error when the response
doesn't include optional capabilities.
@kevindkeogh
Copy link
Author

kevindkeogh commented Aug 23, 2022

Appreciate you developing this tool, I ran into this issue while using the fastmail JMAP API, which doesn't return urn:ietf:params:jmap:submission capability for at least some responses.

@smkent
Copy link
Owner

smkent commented Aug 25, 2022

@kevindkeogh Thanks for the bug report and PR! Interestingly, the primaryAccounts value isn't supposed to contain a value for urn:ietf:params:jmap:core either. I also use jmapc with Fastmail and I get an account ID value back for urn:ietf:params:jmap:core.

I added on to your PR to retrieve the primary account ID on a best effort basis from any of the configured primary account IDs. An Exception is raised if none are found, which I don't think should happen under normal circumstances. I added a unit test for this as well.

@smkent smkent merged commit d748251 into smkent:main Aug 25, 2022
@smkent
Copy link
Owner

smkent commented Aug 25, 2022

I've released 0.2.1 which includes this fix.

smkent added a commit that referenced this pull request Nov 4, 2022
Applied upstream commits:

smkent/cookie-python@5a2e488...224c0e2

*   224c0e2 Merge pull request #64 from smkent/docker-compose-fixup
|\
| * b500da7 Update image path in example docker-compose.yaml
|/
*   89d2312 Merge pull request #63 from smkent/pytest-sugar-py
|\
| * 0f40d43 Add py to dev dependencies
|/
*   1b5710d Merge pull request #62 from smkent/docker
|\
| * eb10487 Add README.md test cases for container publishing
| * a5c094b Update README.md test cases for PyPI install instructions
| * 36a988b Add Docker template bits
| * 0f7d63d Set pyyaml to be a package dependency
* |   838cccf Merge pull request #61 from smkent/readme-pre-commit-2
|\ \
| |/
|/|
| * dfafc26 Add pre-commit to features list
|/
*   d24fca9 Merge pull request #60 from smkent/readme-pre-commit
|\
| * 331f6d3 Update development info in cookie-python README.md for pre-commit
|/
*   8534e71 Merge pull request #59 from smkent/black-template
|\
| * 1dee4ce Configure black line-length in template
|/
*   adca1e4 Merge pull request #51 from smkent/poetry-1.2
|\
| * 285f34d Update RELEASE_POETRY_VERSION to 1.2 in CD workflows
| *   676eb84 Merge remote-tracking branch 'origin/main' into poetry-1.2
| |\
| |/
|/|
* |   4271b52 Merge pull request #57 from smkent/fixup-template-pre-commit-cache-id
|\ \
| * | dcde9c5 Add actions/setup-python output ID in template action
* | |   241a2be Merge pull request #58 from smkent/fixup-license-config
|\ \ \
| |/ /
|/| |
| * | 830f93a Update the license value in pyproject.toml to MIT
|/ /
* |   6183211 Merge pull request #53 from smkent/pre-commit
|\ \
| | * 93bdffc Duplicate `PYTHON_KEYRING_BACKEND` for cookie-python's unit tests
| | * d394931 Move `PYTHON_KEYRING_BACKEND` env var to `poetry install` step
| | * d497ab6 Avoid using a keyring backend with Poetry and Python in CI
| | *   915dc95 Merge remote-tracking branch 'origin/pre-commit' into poetry-1.2
| | |\
| | |/
| |/|
| * | ae00997 Update README.md test cases for README.md updates
| * | fb8b920 Restore cookie-python specific Poe the Poet tasks
| * | 6b66436 Update README.md in cookie-python and template
| * |   13ec742 Merge remote-tracking branch 'origin/main' into pre-commit
| |\ \
| |/ /
|/| |
* | |   e1e9bca Merge pull request #54 from smkent/rm-tox
|\ \ \
| * \ \   6ffe18e Merge remote-tracking branch 'origin/main' into rm-tox
| |\ \ \
| |/ / /
|/| | |
* | | | e36596c Merge pull request #55 from smkent/bandit-toml-toplevel
* | | | 3676e2c Install bandit with the toml extra in cookie-python itself
 / / /
* / / 68465fb Remove tox, which is unused
 / /
* | 03641a9 Update poe tasks for pre-commit in template pyproject.toml
* | 1e74925 Remove unused poe environment variables config
* | 7a204be Skip some subprocess-related checks in bandit
* | e634ffe Add pre-commit configuration
* | 53bea95 Add pre-commit
 /
* 7945b1c Pin poetry-dynamic-versioning to <=0.17.1 for Poetry 1.1.x compatibility
* e872a4d Upgrade requests when installing Poetry
* eba528c Update to Poetry 1.2.x
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