Skip to content

Conversation

@jcox250
Copy link
Contributor

@jcox250 jcox250 commented Jul 9, 2025

What

  • Updates the InventoryRepo so that it stores the version number of resources along with their redis key.
  • When fetching config from Saas, we now compare the version of the new resource pulled down with the version stored in the Proxy's inventory. If the new version is greater then we'll add it to the list of notifications, if it isn't then it will be ignroed and no notifications will be sent.

Why

  • Previously on startup or restart we would send SSE PATCH events for all events. This forced SDKs to reach out to the Proxy and ensured they had the most recent version incase changes were made in Saas while the Proxy was down.
  • Now we'll only send patch events for resources that have actually changed while the Proxy was disconnected from Saas.

Testing

Manually went through the following AC

Acceptance Criteria

Proxy Running

Given I toggle a flag
Then The Proxy should receive an SSE event from Saas, fetch the updated config and store it in redis
And A PATCH SSE event should be forwarded on to my SDK

Given I delete a flag
Then the Proxy should receive a DELETE SSE event and remove the flag from redis
And a DELETE SSE event should be forwarded on to my SDK

Given I create a flag
Then the Proxy should receive a CREATE SSE event from Saas, fetch the config & store it in redis
And a CREATE SSE event should be forwarded on to my SDK

Proxy Disconnected From Saas

Given I delete a flag
When the Proxy reconnects to Saas
Then It should remove the flag from redis & send a DELETE SSE event to SDKs

Given I create a flag
When the Proxy reconnects to Saas
Then it should add the new flag to redis & send a CREATE SSE event to SDKs

Given I patch a flag
When the proxy reconnects to Saas
Then it should update the flags config in redis & send s PATCH sse event

jcox250 and others added 5 commits July 9, 2025 14:53
**What**

- Updates the InventoryRepo so that it stores the version number of resources along with their redis key.
- When fetching config from Saas, we now compare the version of the new
  resource pulled down with the version stored in the Proxy's inventory.
If the new version is greater then we'll add it to the list of
notifications, if it isn't then it will be ignroed and no notifications
will be sent.

**Why**

- Previously on startup or restart we would send SSE PATCH events for
  all events. This forced SDKs to reach out to the Proxy and ensured
they had the most recent version incase changes were made in Saas while
the Proxy was down.
- Now we'll only send patch events for resources that have actually
  changed while the Proxy was disconnected from Saas.
@jcox250 jcox250 merged commit 8798d68 into v2 Jul 10, 2025
4 checks passed
jcox250 added a commit that referenced this pull request Jul 10, 2025
jcox250 added a commit that referenced this pull request Jul 10, 2025
jcox250 added a commit that referenced this pull request Jul 10, 2025
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