Repository navigation
Support attachmentRecordId in association references - #125
Merged
Merged
Conversation
Bumps @haverstack/core to 0.32.0 (and the lockstep wire-types, adapter-local, commons, conformance-fixtures releases) for the new optional attachmentRecordId pointer on attachment associations, which names the _attachment record whose upload established a given reference so shared bytes can resolve a per-reference filename. POST/DELETE /records/:id/associations already pass Association bodies through generically, so the field round-trips with no route change. GET /attachments/:fileId now resolves its own-record/first-record filename fallback via core's new resolveReferencedAttachment() instead of reimplementing that order by hand. Adds conformance coverage for the two new fixtures this release introduces (associate-attachment-record-id, dissociate-attachment-by-identity) and documents the field in docs/api.md. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PmN3empkUtEnouGuDdCatb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for an optional
attachmentRecordIdfield in attachment associations. When multiple records share the samefileId, each can now reference the specific_attachmentrecord whose upload established that reference, preserving the original uploader's filename context.Changes include:
attachmentRecordIdfirstRecordedAttachmenttoresolveReferencedAttachmentwith optional requester context for smarter filename resolutionDocs
Updated
docs/api.mdto document the optionalattachmentRecordIdfield in attachment associations and its use case for multi-record file sharing scenarios.Verification
associate-attachment-record-idanddissociate-attachment-by-identityattachmentRecordIdis stored and retrieved correctlyattachmentRecordId) still matches and removes associationsNotes for reviewers
The
attachmentRecordIdis optional and travels verbatim in both directions—it annotates the reference rather than identifying it. Dissociation uses identity matching on(kind, label, fileId)regardless of whetherattachmentRecordIdis present, allowing flexible cleanup. The filename resolution logic now prefers the requester's own upload context when available, improving the download experience in multi-user scenarios.https://claude.ai/code/session_01PmN3empkUtEnouGuDdCatb