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

[Mobile Config] Add updated_at to GatewayInfoV2 (response) #921

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

kurotych
Copy link
Member

@kurotych kurotych commented Dec 18, 2024

The updated_at field in the response is required to complete the workflow for fetching only the most recently changed hotspots.

This solution is unoptimized since updated_radios is fetched every time. The performance (for v2 endpoints) might be impacted.

The updated_radios hashmap should be cached in future versions.

helium/proto#436

@kurotych kurotych changed the title [Mobile Config] Add updated_at to GatewayInfoV2 responses [Mobile Config] Add updated_at to GatewayInfoV2 (response) Dec 18, 2024
@kurotych kurotych marked this pull request as ready for review December 18, 2024 18:21
Comment on lines 107 to 109
pub updated_at: Option<DateTime<Utc>>,
pub created_at: Option<DateTime<Utc>>,
pub refreshed_at: Option<DateTime<Utc>>,
Copy link

Choose a reason for hiding this comment

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

can you elaborate on the difference between updated_at and refreshed_at -- perhaps consider adding as comments as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

These should be documented in the proto definition. Refreshed means when last the chain was consulted, regardless of whether or not the data has changed. Updated specifically refers to the last time the data was changed

Copy link

Choose a reason for hiding this comment

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

That's where i got confused - the proto only includes updated_at but not refreshed_at
https://github.com/helium/proto/blob/b5564eb32d1fb11d7a0570a1c2311b9ed39d297e/src/service/mobile_config.proto#L81-L84

So refreshed_at is only related to bookkeeping/internals of this service?

Copy link
Member Author

Choose a reason for hiding this comment

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

These should be documented in the proto definition

There is no refreshed_at in proto definition it is internal variable.
updated_at is documented in proto

So refreshed_at is only related to bookkeeping/internals of this service?

Yes refreshed_at is internal thing. I intentionally left only updated_at to not confuse clients.
Also I don't see any purposes for clients to have refreshed_at field

Added comments co code.

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.

4 participants