-
Notifications
You must be signed in to change notification settings - Fork 366
Labels
kind/tech debtAddresses legacy code/decisionsAddresses legacy code/decisionspriority/1 highThis is the top priorityThis is the top priority
Description
Originally posted by @miparnisari in #2859 (review)
We've seen two instances (one: #2636, the other caught in a PR #2859) where a server flag wasn't passed down properly to the datastore's implementation of the server method being called.
this is because the process of passing down a flag involves too many changes and it is VERY to miss a step.
i think a refactor is due.
proposal for Watch:
- split
datastore.WatchOptionsstruct toServerWatchOptionsandClientWatchOptions - add a new
datastore.WatchOptionsDefaultsinterface method that must be overriden per datastore - introduce a common fn
merge(serverOptions, defaultDsOptions, clientWatchOptions) -> ClientAndServerOptions. also,serverWatchOptionsare the same no matter the datastore, so they don't need to live in thecdsormemdbimplementations, they could live insidewatchServer, - have
server.Watch()call the merge function - then we change the
datastore.Watchinterface to takeClientAndServerOptions
This proposal could later be extended to other APIs.
Metadata
Metadata
Assignees
Labels
kind/tech debtAddresses legacy code/decisionsAddresses legacy code/decisionspriority/1 highThis is the top priorityThis is the top priority