Skip to content

fix(core): cache resolved actions in base pipeline#16859

Merged
ematipico merged 2 commits into
withastro:mainfrom
pipe1os:fix/action-caching
May 25, 2026
Merged

fix(core): cache resolved actions in base pipeline#16859
ematipico merged 2 commits into
withastro:mainfrom
pipe1os:fix/action-caching

Conversation

@pipe1os

@pipe1os pipe1os commented May 24, 2026

Copy link
Copy Markdown
Contributor

Changes

  • The getActions() method in base-pipeline.ts was missing an assignment to this.resolvedActions.
  • This caused the actions module to be dynamically re-imported on every single action invocation instead of returning the cached module.
  • This PR adds the missing assignment to properly cache the result and improve performance on action requests, matching the existing caching pattern used in getMiddleware() and getSessionDriver().
  • Included a changeset via pnpm changeset.

Testing

No new tests were added. Because this is purely an internal backend caching optimization, it doesn't change the output or behavior of the pipeline, only the execution time of repeated action calls. A standard reproduction link is not applicable here. The bug and fix can be verified statically by inspecting the previous code:

} else if (this.actions) {
    return this.actions(); // <- missing assignment to this.resolvedActions
}

Docs

No docs added. This is a purely internal server-side performance optimization. It does not affect any public APIs, configuration options, or user-facing behavior, so no documentation updates are required.

@changeset-bot

changeset-bot Bot commented May 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 072cd0c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added the pkg: astro Related to the core `astro` package (scope) label May 24, 2026
@codspeed-hq

codspeed-hq Bot commented May 24, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing pipe1os:fix/action-caching (072cd0c) with main (b22af11)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (4f5a9a8) during the generation of this report, so b22af11 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@ematipico ematipico left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I removed the changeset, this is an internal change and users aren't affected by it

@ematipico ematipico merged commit 221bb4b into withastro:main May 25, 2026
46 of 47 checks passed
@pipe1os pipe1os deleted the fix/action-caching branch May 25, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants