Skip to content

fix(common): allow undefined for PowerSyncCredentials.expiresAt - #1134

Merged
simolus3 merged 1 commit into
powersync-ja:mainfrom
mateusslezinsky:fix/powersync-credentials-expiresat-undefined
Oct 1, 2026
Merged

simolus3 merged 1 commit into
powersync-ja:mainfrom
mateusslezinsky:fix/powersync-credentials-expiresat-undefined

Conversation

@mateusslezinsky

Copy link
Copy Markdown
Contributor

Fixes #324

Summary

Widen PowerSyncCredentials.expiresAt to Date | undefined so connectors
compiled with exactOptionalPropertyTypes can return the property as
explicitly undefined, not only omit it. This is a type-only change with no
runtime behavior difference.

Changes

  • packages/common/src/client/connection/PowerSyncCredentials.ts: expiresAt?: Date → expiresAt?: Date | undefined.
  • packages/common/etc/common.api.md: API report regenerated with API Extractor.
  • .changeset/thin-pumas-shake.md: patch changeset for @powersync/common.

Tests

  • pnpm --filter @powersync/common build
  • pnpm --filter @powersync/common run api-diff
  • Repro of the reported error with exactOptionalPropertyTypes: true: TS1360 before the change, compiles clean after.

`fetchCredentials` implementations compiled with `exactOptionalPropertyTypes`
could not return `{ expiresAt: undefined }` against `expiresAt?: Date`: under
that flag the optional modifier only permits the property to be absent, not to
be present with an `undefined` value.

Widen the type to `Date | undefined` so both forms type-check, and update the
API report accordingly.

Closes powersync-ja#324
@changeset-bot

changeset-bot Bot commented Sep 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6da7208

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

This PR includes changesets to release 6 packages
Name Type
@powersync/common Patch
@powersync/node Patch
@powersync/react-native Patch
@powersync/tanstack-react-query Patch
@powersync/web Patch
@powersync/diagnostics-app Patch

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

@simolus3 simolus3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@simolus3
simolus3 merged commit 3d0d5c4 into powersync-ja:main Oct 1, 2026
6 checks passed
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.

[Improvement/Web] Define undefined in PowerSyncCredentials

2 participants