feat: Add March 2026 API updates and fix carousel ordering#16
Merged
tirthpatell merged 4 commits intomainfrom Mar 6, 2026
Merged
feat: Add March 2026 API updates and fix carousel ordering#16tirthpatell merged 4 commits intomainfrom
tirthpatell merged 4 commits intomainfrom
Conversation
- Add GIFProviderGiphy constant ("GIPHY")
- Update validation to accept both TENOR and GIPHY providers
- Mark GIFProviderTenor as deprecated (sunset March 31, 2026)
- Update comments and tests
SetChildren was sending children in both repeated params and indexed params (children[0], children[1], etc). The indexed format sorts lexicographically, causing items 10+ to appear out of order in carousel posts. The Graph API expects children as a comma-separated string. Also fix AddChild to accumulate correctly and remove dead childIndexKey/toString helper methods.
Greptile SummaryThis PR adds
All fixes are targeted, well-tested, and safe to merge. Confidence Score: 5/5
Sequence DiagramsequenceDiagram
participant Caller
participant ContainerBuilder
participant GraphAPI
note over Caller,GraphAPI: Carousel creation flow (fixed in this PR)
Caller->>ContainerBuilder: SetChildren(["id1","id2",...,"id20"])
note over ContainerBuilder: strings.Join → "id1,id2,...,id20"<br/>(was: children[0]=id1, children[1]=id2, ...<br/>which sorted lexicographically, breaking order at id10+)
ContainerBuilder-->>Caller: *ContainerBuilder
Caller->>ContainerBuilder: Build()
ContainerBuilder-->>Caller: url.Values{"children": ["id1,id2,...,id20"]}
Caller->>GraphAPI: POST /container?children=id1%2Cid2%2C...%2Cid20
GraphAPI-->>Caller: container_id
note over Caller,GraphAPI: GIF provider validation flow (new in this PR)
Caller->>ContainerBuilder: SetGIFAttachment({GIFID: "xyz", Provider: "GIPHY"})
ContainerBuilder-->>Caller: *ContainerBuilder
Caller->>GraphAPI: POST /container?gif_attachment={"gif_id":"xyz","provider":"GIPHY"}
GraphAPI-->>Caller: container_id
Last reviewed commit: 0f9abf8 |
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
GIFProviderGiphyconstant per February 27, 2026 changelog (GIPHY now supported)GIFProviderTenoras deprecated (Tenor API sunset March 31, 2026)SetChildrenwas using indexed params (children[0],children[1], etc.) which sort lexicographically, causing items 10+ to appear out of order. Now uses comma-separated format as expected by the Graph API.Test plan
SetChildrenwith 20+ items verifying order preservationchildren[N]) are producedAddChildaccumulationgo test ./... -short)go build ./...andgo vet ./...clean