Skip to content

Correct the docs on when constructing a Digest can fail - #109

Merged
SeanTAllen merged 1 commit into
mainfrom
fix-digest-construction-docs
Jul 10, 2026
Merged

Correct the docs on when constructing a Digest can fail#109
SeanTAllen merged 1 commit into
mainfrom
fix-digest-construction-docs

Conversation

@SeanTAllen

Copy link
Copy Markdown
Member

PR #92 made the Digest constructors partial, so construction raises when OpenSSL cannot allocate the context. Three statements were left describing the old behavior.

ssl/crypto/crypto.pony said constructing a Digest cannot fail and that the failure surfaces at the first append or final, and it omitted the constructors from the list of partial functions.

.release-notes/next-release.md had two wrong clauses about the same thing. One said a digest that could not be created reports it at the first append or final; the other said construction now raises rather than returning a digest that fails on every later call. Before #92 a failed construction crashed, so both described a state that never shipped.

Closes #106

PR #92 made the `Digest` constructors partial, so construction raises when
OpenSSL cannot allocate the context. The package docstring still said
construction cannot fail and that the failure surfaces at the first
`append` or `final`, and it left the constructors off the list of partial
functions.

Two unreleased release notes were wrong too. One said a digest that could
not be created reports it at the first `append` or `final`; the other said
construction now raises rather than returning a digest that fails on every
later call. Before #92 a failed construction crashed, so both described a
state that never shipped.

Closes #106
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Jul 10, 2026
@SeanTAllen

Copy link
Copy Markdown
Member Author

Autonomous-mode decision log — PR-specific

No release note. The wrong docs arrived with the still-unreleased #92, so nothing incorrect shipped to users; correcting them before release needs no note.

Scope grew after the pre-PR review. I first fixed only the two statements #106 quoted. The reviewer found a third: a sibling note ("Make Digest and HmacSha256 raise on failure") said construction now raises "rather than returning a digest that fails on every later call." I checked the released 2.1.0 constructor — it was non-partial and dereferenced a possibly-null context, so a failed construction crashed. Both wrong clauses describe a state that never shipped, so I corrected both to say "rather than crashing," matching the code and each other.

@SeanTAllen
SeanTAllen merged commit e3646fa into main Jul 10, 2026
15 checks passed
@SeanTAllen
SeanTAllen deleted the fix-digest-construction-docs branch July 10, 2026 19:52
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Jul 10, 2026
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.

ssl/crypto docs say constructing a Digest cannot fail, but it raises

2 participants