Repository navigation
Conversation
getArtifact and listArtifacts({latest: true}) treated the artifact with
the highest ID as the newest one. IDs are not assigned in creation
order, though: when a re-run uploads an artifact with the same name
again, the newer artifact can get the lower ID, and the older one was
returned. Sort by creation time instead and use the ID only to break
ties.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
When several artifacts share a name, which happens when a re-run uploads an artifact again,
getArtifactandlistArtifacts({latest: true})return the one with the highest ID as the newest. Artifact IDs are not assigned in creation order, so the newer artifact can have the lower ID, and the older one is returned.download-artifactuses both, so downloading by name in a re-run can silently fetch the previous attempt's artifact.Two public runs show IDs out of creation order:
github-pagesat 13:43:59Z with ID 11486441618, and the re-run uploadedgithub-pagesat 13:44:49Z with ID 11485144989. See the "successfully finalized" lines in the deploy jobs of attempt 1 and attempt 2.Across 37 artifacts in 7 repositories, a later artifact had the lower ID in 15 of 666 pairs.
Changes
compareNewestFirst, which orders artifacts bycreatedAtand uses the ID only to break ties. An artifact without a creation time counts as the oldest.getArtifactPublic,getArtifactInternalandfilterLatest. The twogetArtifactfunctions now map the response toArtifactbefore picking one, so a single comparator serves all three.getArtifactandlistArtifactswithlatest, public and internal, given two artifacts whose IDs run against their creation times. Those four tests fail without the fix.npm run build,npm test -- packages/artifact(173 tests),npm run lintandnpm run format-checkpass locally on Node 24. I left the version bump andRELEASES.mdto you.🤖 Generated with Claude Code