Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2 (Please be gentle).
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

use TID for rkeys

Akshay bc656a4b 19fd062a

+11 -3
+11 -3
appview/state/state.go
··· 12 12 "time" 13 13 14 14 comatproto "github.com/bluesky-social/indigo/api/atproto" 15 + "github.com/bluesky-social/indigo/atproto/syntax" 15 16 lexutil "github.com/bluesky-social/indigo/lex/util" 16 17 "github.com/gliderlabs/ssh" 17 18 "github.com/go-chi/chi/v5" ··· 29 28 db *db.DB 30 29 auth *auth.Auth 31 30 enforcer *rbac.Enforcer 31 + tidClock *syntax.TIDClock 32 32 } 33 33 34 34 func Make() (*State, error) { ··· 49 47 return nil, err 50 48 } 51 49 52 - return &State{db, auth, enforcer}, nil 50 + clock := syntax.NewTIDClock(0) 51 + 52 + return &State{db, auth, enforcer, clock}, nil 53 + } 54 + 55 + func (s *State) TID() string { 56 + return s.tidClock.Next().String() 53 57 } 54 58 55 59 func (s *State) Login(w http.ResponseWriter, r *http.Request) { ··· 210 202 resp, err := comatproto.RepoPutRecord(r.Context(), client, &comatproto.RepoPutRecord_Input{ 211 203 Collection: tangled.PublicKeyNSID, 212 204 Repo: did, 213 - Rkey: uuid.New().String(), 205 + Rkey: s.TID(), 214 206 Record: &lexutil.LexiconTypeDecoder{ 215 207 Val: &tangled.PublicKey{ 216 208 Created: time.Now().Format(time.RFC3339), ··· 419 411 resp, err := comatproto.RepoPutRecord(r.Context(), client, &comatproto.RepoPutRecord_Input{ 420 412 Collection: tangled.KnotMemberNSID, 421 413 Repo: currentUser.Did, 422 - Rkey: uuid.New().String(), 414 + Rkey: s.TID(), 423 415 Record: &lexutil.LexiconTypeDecoder{ 424 416 Val: &tangled.KnotMember{ 425 417 Member: memberIdent.DID.String(),