Monorepo for Tangled tangled.org

appview/notify: use sets to manage participant list #874

merged
opened by oppi.li targeting master from op/tqlkrqqqlpxu
0
by oppi.li 5 comments
expand 1 commit
appview/notify: use sets to manage participant list

I think map[T]struct{} is just fine, but I do see the values of this abstraction. recipients.Remove(actorDid) seems pretty cool tbh.

How do you think @anirudh.fi ?

there are a couple more usecases for sets that i can think of already across the codebase!

(this also fixes the bug where user who is a participant + mentioned would result in a double notification)

As a seasoned Go writer (I jest) who has never needed this abstraction before, I'm inclined towards a map[T]struct{} but if we're using this elsewhere, then no biggie. @oppi.li thoughts on just vendoring/in-tree'ing this code? Could have a subpackage somewhere…

yes, lets move it into the tree! although i don't expect the library to change much.

sign up or login to add to the discussion
1
by oppi.li 0 comments
expand 1 commit
appview/notify: use sets to manage participant list
Labels

None yet.

assignee

None yet.

Participants 3
AT URI
at://did:plc:qfpnj4og54vl56wngdriaxug/sh.tangled.repo.pull/3m7mtgdbkyi22