Skip to content

migrate placeholer dataSources to providerConnectionRequests#188

Open
ewollesen wants to merge 1 commit into
masterfrom
eric-migrate-pending-data-sources
Open

migrate placeholer dataSources to providerConnectionRequests#188
ewollesen wants to merge 1 commit into
masterfrom
eric-migrate-pending-data-sources

Conversation

@ewollesen

Copy link
Copy Markdown
Contributor

The expirationTime property of dataSources is moved to providerConnectionRequests. The dataSource states of pending and pendingReconnect are no longer valid. They can instead be identified like so:

  • pending: a (non-expired) providerConnectionRequest exists for provider X, but no dataSource for that provider exists.

  • pendingReconnect: a (non-expired) providerConnectionRequest exists for provider X, and there's also a dataSource for that provider, whose state isn't "connected".

BACK-4414

@ewollesen

Copy link
Copy Markdown
Contributor Author

The migration that leads to this change: https://github.com/tidepool-org/tools-private/pull/97

@ewollesen
ewollesen requested a review from darinkrauss May 19, 2026 10:52
@ewollesen
ewollesen force-pushed the eric-migrate-pending-data-sources branch from eecac75 to 726c978 Compare May 19, 2026 10:52
$ref: ./providerId.v1.yaml
x-stoplight:
id: ej94kmuykpg1k
expirationTime:

@ewollesen ewollesen May 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I wonder if we need a "firstConnectedTime" here as well. This would be set when the device is successfully connected for the first time.

You can tell if the device is connected by the existence of a matching data source in the connected state, but you wouldn't know if previous connection requests were ever successful or not.

For example, if a patient had three dexcom connection requests, you couldn't know if the two earliest requests were ever successfully connected or not.

It seems useful to know that, but I don't know that we need to know that. It's not clear that any decision would be made based on knowing that information.

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.

Hmm, not sure. We can always derive firstConnectedTime from the createdTime of the data source itself. If we want to know that a connection was made after a connection request was made, then I'd probably add that here as just connectedTime. That way you could walk back through the connection requests for the provider and "see" somewhat of a history. There are some edge cases we'd need to consider though. (What if a connection was made not using an outstanding invite? What if that connection was made after the expiration?)

@darinkrauss darinkrauss 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.

LGTM!

$ref: ./providerId.v1.yaml
x-stoplight:
id: ej94kmuykpg1k
expirationTime:

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.

Hmm, not sure. We can always derive firstConnectedTime from the createdTime of the data source itself. If we want to know that a connection was made after a connection request was made, then I'd probably add that here as just connectedTime. That way you could walk back through the connection requests for the provider and "see" somewhat of a history. There are some edge cases we'd need to consider though. (What if a connection was made not using an outstanding invite? What if that connection was made after the expiration?)

@ewollesen
ewollesen force-pushed the eric-migrate-pending-data-sources branch from 726c978 to fd92b7d Compare June 25, 2026 13:28
The expirationTime property of dataSources is moved to
providerConnectionRequests. The dataSource states of pending and
pendingReconnect are no longer valid. They can instead be identified
like so:

- pending: a (non-expired) providerConnectionRequest exists for
provider X, but no dataSource for that provider exists.

- pendingReconnect: a (non-expired) providerConnectionRequest exists
for provider X, and there's also a dataSource for that provider, whose
state isn't "connected".

BACK-4414
@ewollesen
ewollesen force-pushed the eric-migrate-pending-data-sources branch from fd92b7d to 1fc450f Compare July 21, 2026 08:13
@ewollesen

Copy link
Copy Markdown
Contributor Author

Squashed down to a single commit, and rebased onto latest master.

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.

3 participants