mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
* fix(identity): 2 defect(s) (OC-0192, OC-0197)
OC-0192: bound raw display_name/about/avatar bytes before the quadratic
fixpoint sanitizer runs, in both the REST handler and UserService.UpdateProfile.
OC-0197: sanitize display_name before validateDisplayName so an
HTML-entity-encoded bidi override (e.g. "‮") can no longer pass
validation as ASCII and be decoded into the real character on the way to
storage.
* fix(ws): 1 defect(s) (OC-0196)
A transient DB error during WebSocket auth (session or user lookup) was
collapsed into the terminal auth_error frame, which the client treats as
non-recoverable: it stops reconnecting and clears stored credentials. A
sub-second SQLite hiccup therefore force-logged-out every reconnecting
client with a perfectly valid session. Send a non-terminal INTERNAL error
frame instead so normal backoff/reconnect retries.
* fix(api): 1 defect(s) (OC-0198)
* fix(ws): 1 defect(s) (OC-0200)
normalizeHostForCertCompare now unwraps a bracketed IPv6 literal after the
trailing-":443" strip and before lowercasing, matching tofu::cert_store_key's
normalization order. Without the unwrap, every cert-tofu host equality guard
took the "unrelated host" branch for bracketed-IPv6 servers.
* fix(api): 1 defect(s) (OC-0202)
* fix(admin): 1 defect(s) (OC-0203)
Channel permission override handlers applied requireGrantableOverride only
to the bits being written, so an all-zero PUT or a DELETE could clear a
deny bit the actor's own role does not hold — EffectivePerms =
(rolePerm &^ deny) | allow makes removing a deny an escalation. Both the
role-layer and per-user handlers now check the guard against the bits
already on the row.
* fix(client): 1 defect(s) (OC-0205)
* fix(client): 3 defect(s) (OC-0207, OC-0227, OC-0235)
* fix(client): 1 defect(s) (OC-0208)
* fix(voice): 3 defect(s) (OC-0209, OC-0212, OC-0213)
OC-0209: reject a replayed retired-key announce before verifyPeerAnnounce
runs, so the replay cannot overwrite the peer's displayed verification
status/session fingerprint with the retired key's before being rejected.
OC-0212: buffer an announce blocked as a TOFU pin mismatch and replay it
after a successful rePinPeerIdentity, so re-pinning actually restores the
peer for the live call instead of clearing the badge and leaving them
un-keyed (a mid-call peer never re-announces on its own).
OC-0213: skip retiring a departing peer's key when the local voice roster
still lists them as present — a rejoin announce published straight into
the send queue can overtake the buffered, stale voice_leave, and retiring
a still-live key would reject every later genuine re-announce as a replay.
* fix(ws): 1 defect(s) (OC-0211)
* fix(identity): 1 defect(s) (OC-0214)
The delete-account admin guard counted remaining admins with a raw
`banned = 0` filter, so an admin whose temporary ban had already lapsed
was treated as unusable. Use the shared notBannedClause, appended outside
the Sprintf format string because its strftime verbs (%Y, %H) would
otherwise be parsed as fmt directives.
* fix(client): 1 defect(s) (OC-0215)
* fix(voice): 1 defect(s) (OC-0216)
* fix(client): 1 defect(s) (OC-0217)
* fix(voice): 1 defect(s) (OC-0219)
rollbackVoiceJoin cleared the client's in-memory voiceChID but left its
VoiceTopic subscription in place, so a socket whose join failed after
voiceJoinComplete's Subscribe kept receiving that room's E2EE relays for
the rest of the connection. Use clearVoiceAndUnsubscribe instead, matching
every other path that takes a client out of voice while its WS stays up.
* fix(client): 2 defect(s) (OC-0220, OC-0224)
dmDisplayName: a group DM whose other members have all left keeps a live
is_group row, but the server leaves `recipient` zero-valued, so the empty
username fell through as a blank label. Fall back to a non-empty placeholder.
updateDmLastMessage: a queued chat_message redelivered for an id already
reflected in the `ready` snapshot double-counted the unread badge. Only
increment when the message id advances past lastMessageId.
* fix(client): 1 defect(s) (OC-0221)
Cap queued attachments at the server's 10-attachment limit in the message
composer. Past that the server rejects the whole chat_send frame as a
generic parse error, orphaning already-uploaded attachments; refusing
before the upload starts keeps composer state and the send in sync.
* fix(ws): 1 defect(s) (OC-0222)
handleReconnect built the resume auth_ok before applyConnectStatus settled
c.user.Status, so a resumed client was told its disconnect-time status
(routinely "offline") instead of the status it was coming online as.
Move applyConnectStatus ahead of reconnectWriteReplay, matching
handleFreshConnect's ordering.
* fix(mentions): 1 defect(s) (OC-0223)
* fix(admin): 1 defect(s) (OC-0225)
* fix(client): 1 defect(s) (OC-0226)
* fix(client): 1 defect(s) (OC-0228)
* fix(client): 1 defect(s) (OC-0230)
Route the Logs tab entry counter through renderLogEntries so every render path (filter change, Clear, Refresh, live entry) keeps the count in sync with the list.
* fix(voice): 1 defect(s) (OC-0231)
* fix(client): 1 defect(s) (OC-0232)
Reduce Motion toggle wrote the reduced-motion class directly, fighting the
OS-sync media-query listener that owns it when Sync with OS is on. Route the
side effect through syncOsMotionListener so whichever source owns the class
re-derives it.
* fix(client): 1 defect(s) (OC-0233)
notifyIncomingMessage titled the desktop notification with the raw
payload username, so the popup named the sender differently from the
message row it points at. Resolve the author the same way the message
list does (resolveAuthor over the live membersStore, then
resolveDisplayName).
* fix(client): 1 defect(s) (OC-0234)
* fix(client): 1 defect(s) (OC-0236)
* fix(ws): 1 defect(s) (OC-0237)
* fix(client): 4 defect(s) (OC-0193, OC-0201, OC-0204, OC-0218)
* fix(identity): 1 defect(s) (OC-0195)
Bound free-text profile fields by raw byte length before cleanText's
quadratic sanitizeToFixpoint pass runs, generalizing OC-0192's guard into
cleanTextBounded and applying it to HandlePresenceUpdate's custom_status,
SetCustomStatus, and group DM names.
* fix(dm): 1 defect(s) (OC-0199)
handleCreateDM now broadcasts dm_channel_open to the recipient when a 1:1 DM is newly created, matching handleCreateGroupDM. GetOrCreateDMChannel pre-seeds dm_open_state for both users, so the recipient's later OpenDM reported opened=false and nothing ever told them the DM existed.
* fix(voice): 1 defect(s) (OC-0206)
vad-worklet.js gate timing constants were copied from the setTimeout
fallback's ~16ms poll cadence, but AudioWorkletProcessor.process() runs
once per 128-sample render quantum (~2.667ms at the 48kHz AudioContext).
The mic gate therefore closed ~6x faster than intended (~32ms of silence
instead of ~200ms), with the startup grace and RMS post interval off by
the same factor. Scale the frame counts to render quanta.
* fix(client): 1 defect(s) (OC-0229)
* test(client): assert the real TOFU re-pin outcome and make the pin mock faithful
The e2e journey test asserted that "Trust New Key" makes the peer's verify
badge disappear. That is the behaviour OC-0212 identifies as the defect: a
mid-call peer never re-announces, so clearing the badge left the peer
un-keyed for the rest of the call with nothing on screen. Re-pinning now
replays the announce that was blocked as a mismatch and re-verifies it
against the pin just stored, so assert the peer actually lands verified.
The mock's store_identity_pin was a no-op recorder while get_identity_pin
served a static seed map, so the replayed announce re-read the stale pin and
re-failed — a mismatch the real keyring never produces. Back the pins with a
mutable map so a write is visible to the next read. The unreadable-store
(DC-08) and reject-keeps-blocked paths are unchanged and still pass.
* fix(dm): 1 defect(s) (OC-0194)
Add regression tests pinning the raw-byte bound on group DM names, for
both CreateGroupDM and RenameGroupDM.
The Server/service/dm.go source fix for OC-0194 already landed in
bdbd5ac (fix(identity): 1 defect(s) (OC-0195)), which generalized the
guard into cleanTextBounded and applied it to the group DM name paths
alongside the profile fields. This commit therefore carries the OC-0194
tests only; dm.go is unchanged.
Revert-proof: with dm.go restored to bdbd5ac^ (cleanText before the
rune-count check) both new tests fail — CreateGroupDM returns "recipient
not found" after 222ms and RenameGroupDM accepts the name after 251ms,
against a 150ms budget. With the fix in place both pass in 0.03s.
* fix(ws): 1 defect(s) (OC-0210)
* chore(findings): record the 2026-08-20 hunt's 46 findings as fixed
Appends OC-0192..OC-0237 from the 2026-08-20 converging hunt and marks each
fixed with its commit and the test that pins it. Pre-existing records are
byte-identical; nextId moves 192 -> 238 so the next hunt cannot collide with
these ids.
Every fix was independently revert-proofed: the commit's own source diff is
reverse-applied, its test must go red, and must return green once restored.
43 of 46 carry revertProof "pass" from that mechanical run. Three could not be
checked at file level and were proved by hand at hunk level instead, recorded
as "pass (hand-proved)": OC-0200, whose ws.ts edit no longer reverse-applies
because the merge kept main's equivalent implementation; OC-0215, whose Rust
tests live in-file under #[cfg(test)]; and OC-0194, which stacks on a helper
introduced by an earlier commit. No fix was found to rest on a vacuous test.
OC-0200 additionally carries a note: main fixed that same normalizer
independently while this branch was in flight, so the branch is no longer the
only thing closing it.
* docs: record the dm_channel_open emission on 1:1 DM creation
POST /api/v1/dms now emits dm_channel_open to the recipient when it creates a
channel (it previously emitted nothing on that path), so api.md states it the
way the sibling DM endpoints already state theirs.
The channels/members/DMs UX spec claimed the server broadcast the event "to
both parties" on this flow. That was never true — nothing was broadcast before,
and now only the recipient is sent it; the creator learns the channel from the
response body. This doc lists dispatcher.ts, dm.store.ts, ChannelSidebar.ts,
service/channel.go and dm.go among its sources of truth, all touched here, so
it is corrected in the same change per its maintenance rule.
---------
Co-authored-by: Claude <noreply@anthropic.com>
337 lines
11 KiB
Go
337 lines
11 KiB
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
"log/slog"
|
|
"regexp"
|
|
"slices"
|
|
"strings"
|
|
|
|
"github.com/owncord/server/db"
|
|
"github.com/owncord/server/permissions"
|
|
)
|
|
|
|
// maxMentionsPerMessage caps how many usernames one message can resolve.
|
|
// Tokens past the cap stay plain text, bounding both the stored rows and the
|
|
// read-state writes a single send can trigger.
|
|
const maxMentionsPerMessage = 20
|
|
|
|
// maxMentionCandidates caps how many distinct @tokens are looked up per
|
|
// message, so a wall of @words cannot turn one send into an unbounded query.
|
|
const maxMentionCandidates = 60
|
|
|
|
// mentionTokenRe matches an @token that stands alone as a word. Group 1 is the
|
|
// preceding character, which must be start-of-string or a non-word non-@ rune
|
|
// ("mail@example" and "@@name" never resolve); group 2 is the token; group 3
|
|
// captures a trailing "@" so address-shaped text like "@bob@example.com" is
|
|
// rejected as a whole rather than half-matched. The token charset is letters,
|
|
// digits, underscore, dot and hyphen — usernames may hold any printable rune,
|
|
// but only this subset is addressable without an explicit delimiter.
|
|
var mentionTokenRe = regexp.MustCompile(`(^|[^\p{L}\p{N}_@])@([\p{L}\p{N}_.-]{1,64})(@?)`)
|
|
|
|
// everyoneToken and hereToken are reserved: a user literally named "everyone"
|
|
// is not resolvable by @everyone.
|
|
const (
|
|
everyoneToken = "everyone"
|
|
hereToken = "here"
|
|
)
|
|
|
|
// mentionSet is the resolved mention state of one message.
|
|
type mentionSet struct {
|
|
// UserIDs is ordered by first appearance in the content, deduplicated and
|
|
// capped at maxMentionsPerMessage. Never nil.
|
|
UserIDs []int64
|
|
// Everyone reports an @everyone or @here that cleared the MENTION_EVERYONE
|
|
// gate. Without the bit the token keeps no mention semantics at all.
|
|
Everyone bool
|
|
// HereOnly narrows an Everyone fan-out to users who are not offline. It is
|
|
// set when @here matched and @everyone did not.
|
|
HereOnly bool
|
|
}
|
|
|
|
// mentionCandidate is one @token and the username spellings it may resolve to,
|
|
// in preference order. Trailing sentence punctuation is stripped in the second
|
|
// spelling so "@bob." resolves to bob when no user is named "bob.".
|
|
type mentionCandidate struct {
|
|
spellings []string
|
|
}
|
|
|
|
// parseMentionTokens extracts the @tokens of a message. Returned tokens are
|
|
// lowercased, distinct and ordered by first appearance; the reserved
|
|
// @everyone / @here tokens are reported separately and never resolved as
|
|
// usernames.
|
|
func parseMentionTokens(content string) (tokens []mentionCandidate, everyone, here bool) {
|
|
seen := make(map[string]struct{})
|
|
for _, m := range mentionTokenRe.FindAllStringSubmatch(content, -1) {
|
|
if m[3] == "@" {
|
|
continue // address-shaped, e.g. "@bob@example.com"
|
|
}
|
|
// db.LowerASCII, not strings.ToLower: usernames.username is only
|
|
// COLLATE NOCASE, which folds ASCII A-Z only. A Unicode fold here
|
|
// (e.g. 'É' -> 'é') would desync this token from GetUserIDsByUsernames'
|
|
// equally ASCII-folded map key, so a username holding an uppercase
|
|
// non-ASCII letter could never resolve (OC-0131).
|
|
raw := db.LowerASCII(m[2])
|
|
switch raw {
|
|
case everyoneToken:
|
|
everyone = true
|
|
continue
|
|
case hereToken:
|
|
here = true
|
|
continue
|
|
}
|
|
if _, dup := seen[raw]; dup {
|
|
continue
|
|
}
|
|
seen[raw] = struct{}{}
|
|
spellings := []string{raw}
|
|
if trimmed := strings.TrimRight(raw, ".-"); trimmed != "" && trimmed != raw {
|
|
spellings = append(spellings, trimmed)
|
|
}
|
|
tokens = append(tokens, mentionCandidate{spellings: spellings})
|
|
if len(tokens) >= maxMentionCandidates {
|
|
break
|
|
}
|
|
}
|
|
return tokens, everyone, here
|
|
}
|
|
|
|
// resolveMentions turns sanitized content into a mentionSet. Unknown @words
|
|
// resolve to nothing and stay plain text, and @everyone/@here without the
|
|
// MENTION_EVERYONE bit on this channel does the same. DM channels have no
|
|
// @everyone semantics — there is no permission surface to answer to.
|
|
//
|
|
// Resolution failures are logged and treated as "no mentions": a message must
|
|
// not be rejected because its mention lookup failed.
|
|
func (s *MessageService) resolveMentions(ctx context.Context, content string, authorID, channelID int64, isDM bool) mentionSet {
|
|
set := mentionSet{UserIDs: []int64{}}
|
|
|
|
tokens, everyone, here := parseMentionTokens(content)
|
|
if (everyone || here) && !isDM &&
|
|
s.perms.HasChannelPerm(ctx, authorID, channelID, permissions.ReadMessages|permissions.MentionEveryone) {
|
|
set.Everyone = true
|
|
set.HereOnly = here && !everyone
|
|
}
|
|
if len(tokens) == 0 {
|
|
return set
|
|
}
|
|
|
|
lookup := make([]string, 0, len(tokens)*2)
|
|
for _, t := range tokens {
|
|
lookup = append(lookup, t.spellings...)
|
|
}
|
|
byName, err := s.st.GetUserIDsByUsernames(ctx, lookup)
|
|
if err != nil {
|
|
slog.Error("MessageService.resolveMentions GetUserIDsByUsernames", "err", err, "channel_id", channelID)
|
|
return set
|
|
}
|
|
|
|
seen := make(map[int64]struct{}, len(tokens))
|
|
for _, t := range tokens {
|
|
for _, spelling := range t.spellings {
|
|
id, ok := byName[spelling]
|
|
if !ok {
|
|
continue
|
|
}
|
|
if _, dup := seen[id]; !dup {
|
|
seen[id] = struct{}{}
|
|
set.UserIDs = append(set.UserIDs, id)
|
|
}
|
|
break
|
|
}
|
|
if len(set.UserIDs) >= maxMentionsPerMessage {
|
|
break
|
|
}
|
|
}
|
|
return set
|
|
}
|
|
|
|
// applyMentionCounts increments read_states.mention_count for every user the
|
|
// message mentions who can see the channel, except the author and except users
|
|
// who have blocked the author. @everyone reaches every reader; @here reaches
|
|
// only readers who are not offline.
|
|
//
|
|
// Edits deliberately never call this: a mention that was already counted must
|
|
// not be counted twice, and the simplest rule that guarantees it is that only
|
|
// the original insert can raise a badge.
|
|
//
|
|
// The message is already committed by the time this runs, so failures are
|
|
// logged rather than surfaced — a lost badge must not fail a delivered send.
|
|
func (s *MessageService) applyMentionCounts(ctx context.Context, channelID, msgID, authorID int64, set mentionSet, isDM bool, participantIDs []int64) {
|
|
if len(set.UserIDs) == 0 && !set.Everyone {
|
|
return
|
|
}
|
|
|
|
readers, err := s.mentionReaders(ctx, channelID, isDM, participantIDs)
|
|
if err != nil {
|
|
slog.Error("MessageService.applyMentionCounts readers", "err", err, "channel_id", channelID)
|
|
return
|
|
}
|
|
|
|
recipients := make(map[int64]struct{}, len(readers))
|
|
if set.Everyone {
|
|
for _, r := range readers {
|
|
// db.BroadcastStatus, not a bare == "offline": the column stores the
|
|
// status the user *chose*, so an invisible reader holds "invisible"
|
|
// here and a literal comparison would ping them with @here — the one
|
|
// thing "appear offline" is meant to stop. Collapsing first makes
|
|
// @here agree with what everyone else can see of that reader.
|
|
//
|
|
// That column check alone is not enough: users.status keeps a
|
|
// *chosen* idle/dnd across a disconnect by design
|
|
// (MarkUserDisconnected only ever rewrites "online" -> "offline"),
|
|
// so a signed-out reader whose last status was idle/dnd would still
|
|
// read as non-offline here. s.online (nil-safe) applies the read
|
|
// path's "no live connection is offline, whatever the row says"
|
|
// rule (ws/serve_ready.go presentableMembers) to close that gap.
|
|
if set.HereOnly && (db.BroadcastStatus(r.Status) == db.StatusOffline ||
|
|
(s.online != nil && !s.online(r.UserID))) {
|
|
continue
|
|
}
|
|
recipients[r.UserID] = struct{}{}
|
|
}
|
|
}
|
|
if len(set.UserIDs) > 0 {
|
|
// Build the reader set once instead of scanning readers per mentioned
|
|
// uid: that nested loop was O(mentions x readers), which gets
|
|
// expensive on a channel with many readers.
|
|
readerIDs := make(map[int64]struct{}, len(readers))
|
|
for _, r := range readers {
|
|
readerIDs[r.UserID] = struct{}{}
|
|
}
|
|
for _, uid := range set.UserIDs {
|
|
if _, ok := readerIDs[uid]; ok {
|
|
recipients[uid] = struct{}{}
|
|
}
|
|
}
|
|
}
|
|
delete(recipients, authorID)
|
|
if len(recipients) == 0 {
|
|
return
|
|
}
|
|
|
|
blockers, err := s.st.ListBlockersOf(ctx, authorID)
|
|
if err != nil {
|
|
slog.Error("MessageService.applyMentionCounts ListBlockersOf", "err", err, "user_id", authorID)
|
|
return // Fail closed: a badge from a blocked user is worse than no badge.
|
|
}
|
|
for _, b := range blockers {
|
|
delete(recipients, b)
|
|
}
|
|
if len(recipients) == 0 {
|
|
return
|
|
}
|
|
|
|
ids := make([]int64, 0, len(recipients))
|
|
for id := range recipients {
|
|
ids = append(ids, id)
|
|
}
|
|
if err := s.st.IncrementMentionCounts(ctx, channelID, msgID, ids); err != nil {
|
|
slog.Error("MessageService.applyMentionCounts IncrementMentionCounts", "err", err, "channel_id", channelID)
|
|
}
|
|
}
|
|
|
|
// mentionReaders lists the users who can read the channel, with the presence
|
|
// status @here filters on. DM participation is membership, not permissions, so
|
|
// DMs skip the role walk entirely.
|
|
func (s *MessageService) mentionReaders(ctx context.Context, channelID int64, isDM bool, participantIDs []int64) ([]db.MentionTarget, error) {
|
|
if isDM {
|
|
targets := make([]db.MentionTarget, 0, len(participantIDs))
|
|
for _, pid := range participantIDs {
|
|
targets = append(targets, db.MentionTarget{UserID: pid})
|
|
}
|
|
return targets, nil
|
|
}
|
|
|
|
roles, err := s.st.ListRoles(ctx)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
overrides, err := s.st.GetChannelOverrides(ctx, channelID)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
readRoles := make([]int64, 0, len(roles))
|
|
adminRoles := make(map[int64]bool, len(roles))
|
|
for _, r := range roles {
|
|
if r == nil {
|
|
continue
|
|
}
|
|
o := overrides[r.ID]
|
|
eff := permissions.EffectivePerms(r.Permissions, o.Allow, o.Deny)
|
|
if permissions.HasAdmin(r.Permissions) {
|
|
adminRoles[r.ID] = true
|
|
}
|
|
if permissions.HasAdmin(r.Permissions) || eff&permissions.ReadMessages != 0 {
|
|
readRoles = append(readRoles, r.ID)
|
|
}
|
|
}
|
|
targets, err := s.st.ListMentionTargetsByRoles(ctx, readRoles)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return s.applyUserOverridesToReaders(ctx, channelID, targets, adminRoles)
|
|
}
|
|
|
|
// applyUserOverridesToReaders folds the per-user override layer into a reader
|
|
// set the role walk produced. The layer is last in the resolution order, so it
|
|
// moves members in both directions:
|
|
//
|
|
// - a user DENY of READ_MESSAGES drops a member their role admitted (unless
|
|
// they hold ADMINISTRATOR, which bypasses every override), and
|
|
// - a user ALLOW of READ_MESSAGES adds a member their role excluded.
|
|
//
|
|
// A user allow also beats a user deny on the same bit, matching
|
|
// permissions.EffectiveChannelPerms.
|
|
func (s *MessageService) applyUserOverridesToReaders(
|
|
ctx context.Context, channelID int64, targets []db.MentionTarget, adminRoles map[int64]bool,
|
|
) ([]db.MentionTarget, error) {
|
|
userOv, err := s.st.GetChannelUserOverrides(ctx, channelID)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if len(userOv) == 0 {
|
|
return targets, nil
|
|
}
|
|
|
|
granted := make([]int64, 0, len(userOv))
|
|
revoked := make(map[int64]bool, len(userOv))
|
|
for uid, o := range userOv {
|
|
switch {
|
|
case o.UserAllow&permissions.ReadMessages != 0:
|
|
granted = append(granted, uid)
|
|
case o.UserDeny&permissions.ReadMessages != 0:
|
|
revoked[uid] = true
|
|
}
|
|
}
|
|
|
|
kept := make([]db.MentionTarget, 0, len(targets))
|
|
present := make(map[int64]bool, len(targets))
|
|
for _, t := range targets {
|
|
if revoked[t.UserID] && !adminRoles[t.RoleID] {
|
|
continue
|
|
}
|
|
present[t.UserID] = true
|
|
kept = append(kept, t)
|
|
}
|
|
|
|
missing := make([]int64, 0, len(granted))
|
|
for _, uid := range granted {
|
|
if !present[uid] {
|
|
missing = append(missing, uid)
|
|
}
|
|
}
|
|
if len(missing) == 0 {
|
|
return kept, nil
|
|
}
|
|
// Deterministic order so the fan-out (and its tests) do not depend on map
|
|
// iteration order.
|
|
slices.Sort(missing)
|
|
added, err := s.st.ListMentionTargetsByUserIDs(ctx, missing)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return append(kept, added...), nil
|
|
}
|