Skip to content

Conversation

@gasolima
Copy link
Contributor

@gasolima gasolima commented Nov 24, 2025

The database .load() function was expecting that the data file would always conform to the exact (collection) schema that was defined in the database.

In general this should be true, but there is one exception:

  • If we are adding new collections; and
  • We are doing a database diff between a new database (with the new schema) and the currently published version of the database (created using the old schema)

Instead, we will treat the missing keys as empty.

@gasolima gasolima changed the title fix(tskb): handle missing relationship data during database hydration fix: handle missing relationship data during database hydration Nov 24, 2025
}
if (!!proto && typeof proto === 'object' && !!x && typeof x === 'object') {
for (const [k, v] of Object.entries(proto)) {
hydrate(v, (x as any)[k]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to add the check here, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

make sense

@rix0rrr rix0rrr changed the title fix: handle missing relationship data during database hydration fix: loading database crashes if collections are missing Nov 24, 2025
@rix0rrr rix0rrr enabled auto-merge November 24, 2025 12:22
@github-actions
Copy link
Contributor

@aws-cdk/aws-service-spec: No model change detected

@rix0rrr rix0rrr added this pull request to the merge queue Nov 24, 2025
Merged via the queue into main with commit f6a7813 Nov 24, 2025
10 checks passed
@rix0rrr rix0rrr deleted the fix-db-diff branch November 24, 2025 12:49
mergify bot pushed a commit to aws/aws-cdk that referenced this pull request Nov 24, 2025
### Issue # (if applicable)

This PR picking up the [diff db](cdklabs/awscdk-service-spec#2237) fix, to be able to review the changes happening in the PRs for L1s

### Reason for this change



### Description of changes



### Describe any new or updated permissions being added




### Description of how you validated changes



### Checklist
- [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
github-merge-queue bot pushed a commit that referenced this pull request Nov 24, 2025
…rvice-spec-types (#2238)

Should have been released with
#2237 but didn't. Now
we are forcing the release of these packages.

---------

Co-authored-by: Momo Kornher <[email protected]>
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