Skip to content

Remove Upsert from DataStorage interface — no production callers remain after #4669 #4726

@yrobla

Description

@yrobla

Context

Raised as a suggestion in #4669, which converted all five production call sites from Upsert to Update.

After that PR, Upsert has zero production callers in the session manager. The only remaining references are test fixtures seeding storage state, which can use Create or direct setup helpers instead.

Problem

Keeping Upsert in the DataStorage interface risks future contributors accidentally reintroducing the unconditional-write pattern that #4669 was specifically designed to eliminate. An unused interface method is a footgun with no upside.

Suggestion

Remove Upsert from the DataStorage interface entirely:

  • Remove Upsert from DataStorage in pkg/transport/session/session_data_storage.go
  • Remove or replace Upsert implementations in RedisSessionDataStorage and LocalSessionDataStorage
  • Update test fixtures that call Upsert to use Create or direct setup helpers instead
  • Verify no remaining callers exist outside of tests

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreenhancementNew feature or requestgoPull requests that update go code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions