Skip to content

Commit 0eb9495

Browse files
chore(release): 4.0.0 [skip ci]
# [4.0.0](v3.23.3...v4.0.0) (2025-02-11) * fix!: user pool creation race conditions ([69ee1e1](69ee1e1)) ### BREAKING CHANGES * You must create a User Pool before using it (by calling createUserPool). Previously, User Pools would be created on-demand. User Pools (and their associated databases) used to be created lazily when first accessed, this was intended to to allow low-touch setup of cognito-local by creating user pools with default options if they don't exist, but it has been a source of obscure corruption issues for a while. It's been possible to create race conditions by making requests to cognito-local in parallel before a User Pool was created, and those parallel requests would stomp on each other by creating multiple databases. This change removes the laziness: Any existing User Pools will be parsed when cognito-local first starts, and new User Pools are created when createUserPool is called. Any attempts to access User Pools which don't exist will fail with a ResourceNotFound error.
1 parent 6589a9e commit 0eb9495

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
# [4.0.0](https://github.com/jagregory/cognito-local/compare/v3.23.3...v4.0.0) (2025-02-11)
2+
3+
4+
* fix!: user pool creation race conditions ([69ee1e1](https://github.com/jagregory/cognito-local/commit/69ee1e17f9daa2872660f33c538ee5bdf5443ef5))
5+
6+
7+
### BREAKING CHANGES
8+
9+
* You must create a User Pool before using it (by calling
10+
createUserPool). Previously, User Pools would be created on-demand.
11+
12+
User Pools (and their associated databases) used to be created lazily
13+
when first accessed, this was intended to to allow low-touch setup of
14+
cognito-local by creating user pools with default options if they don't
15+
exist, but it has been a source of obscure corruption issues for a
16+
while. It's been possible to create race conditions by making requests
17+
to cognito-local in parallel before a User Pool was created, and those
18+
parallel requests would stomp on each other by creating multiple
19+
databases.
20+
21+
This change removes the laziness: Any existing User Pools will be parsed
22+
when cognito-local first starts, and new User Pools are created when
23+
createUserPool is called. Any attempts to access User Pools which don't
24+
exist will fail with a ResourceNotFound error.
25+
126
## [3.23.3](https://github.com/jagregory/cognito-local/compare/v3.23.2...v3.23.3) (2024-03-21)
227

328

0 commit comments

Comments
 (0)