Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ses): Move makeLRUCacheMap to a dedicated file #1983

Merged
merged 3 commits into from
Jan 22, 2024

Conversation

gibson042
Copy link
Contributor

Description

makeLRUCacheMap is only used by the SES error system, but is not really specific to it. It should eventually be an endo export, possibly in its own package (just not in common, which itself depends upon ses), but this PR just promotes it up one level into an easily-movable file for when that time comes.

Security Considerations

This code is depended upon by SES assert code, and therefore cannot itself assume a hardened environment. All of the existing commentary and freeze calls were preserved.

Scaling Considerations

n/a

Documentation Considerations

None yet.

Testing Considerations

Testing was consolidated into packages/ses/test/test-lru-cache-map.js.

Upgrade Considerations

n/a

@gibson042 gibson042 force-pushed the gibson-2024-01-move-lru-cachemap branch from 778c03e to ad116cd Compare January 19, 2024 08:41
Copy link
Contributor

@erights erights left a comment

Choose a reason for hiding this comment

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

LGTM, much better, thanks!

Given that it has to work before lockdown, it itself does not to be exported in that form. Rather, a trivial but post-lockdown wrapper of this could be what it exported.

OTOH, given adequate use of freeze to emulate full hardening, exporting from a lower layer package is fine. As you say, it cannot be @endo/common because of this layering. In any case, this PR is the right first step.

@gibson042 gibson042 enabled auto-merge January 22, 2024 20:43
It should eventually be an endo export, possibly in its own package
(just not in `common`, which itself depends upon `ses`).
@gibson042 gibson042 force-pushed the gibson-2024-01-move-lru-cachemap branch from ad116cd to 1adcc57 Compare January 22, 2024 20:44
@gibson042 gibson042 merged commit bb2833f into master Jan 22, 2024
14 checks passed
@gibson042 gibson042 deleted the gibson-2024-01-move-lru-cachemap branch January 22, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants