Skip to content

Conversation

@ascorbic
Copy link
Contributor

Changes

Currently the action API context is created by destructuring the unused properties of the context object. This was causing warnings to be logged because it copies by value, meaning the session get method was being called.

This PR switches to using Object.create and getOwnPropertyDescriptors, which preserves the accessors on the object, menaing the session getter isn't called unless the user accesses it.

Fixes #13644

Testing

Tested with the repro for #13644

Docs

@changeset-bot
Copy link

changeset-bot bot commented Apr 17, 2025

🦋 Changeset detected

Latest commit: ba476e0

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Apr 17, 2025
@ascorbic ascorbic self-assigned this Apr 17, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Apr 17, 2025

CodSpeed Performance Report

Merging #13647 will not alter performance

Comparing ctx-clone (ba476e0) with main (23410c6)

Summary

✅ 6 untouched benchmarks

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Nice catch!

@ascorbic ascorbic merged commit ffbe8f2 into main Apr 17, 2025
16 checks passed
@ascorbic ascorbic deleted the ctx-clone branch April 17, 2025 13:27
@astrobot-houston astrobot-houston mentioned this pull request Apr 17, 2025
openscript pushed a commit to openscript/astro that referenced this pull request Sep 12, 2025
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.

Cookies being recognized as sessions leading to an error

2 participants