this repo has no description
0
fork

Configure Feed

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

lexgen with sync v1.1 lexicons, and other tweaks (2025-02-21) (#954)

authored by

bnewbold and committed by
GitHub
8af67f52 2503553e

+192 -82
+1 -37
api/atproto/cbor_gen.go
··· 343 343 } 344 344 345 345 cw := cbg.NewCborWriter(w) 346 - fieldCount := 13 346 + fieldCount := 12 347 347 348 348 if t.Blocks == nil { 349 349 fieldCount-- ··· 426 426 if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Seq-1)); err != nil { 427 427 return err 428 428 } 429 - } 430 - 431 - // t.Prev (util.LexLink) (struct) 432 - if len("prev") > 1000000 { 433 - return xerrors.Errorf("Value in field \"prev\" was too long") 434 - } 435 - 436 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("prev"))); err != nil { 437 - return err 438 - } 439 - if _, err := cw.WriteString(string("prev")); err != nil { 440 - return err 441 - } 442 - 443 - if err := t.Prev.MarshalCBOR(cw); err != nil { 444 - return err 445 429 } 446 430 447 431 // t.Repo (string) (string) ··· 768 752 } 769 753 770 754 t.Seq = int64(extraI) 771 - } 772 - // t.Prev (util.LexLink) (struct) 773 - case "prev": 774 - 775 - { 776 - 777 - b, err := cr.ReadByte() 778 - if err != nil { 779 - return err 780 - } 781 - if b != cbg.CborNull[0] { 782 - if err := cr.UnreadByte(); err != nil { 783 - return err 784 - } 785 - t.Prev = new(util.LexLink) 786 - if err := t.Prev.UnmarshalCBOR(cr); err != nil { 787 - return xerrors.Errorf("unmarshaling t.Prev pointer: %w", err) 788 - } 789 - } 790 - 791 755 } 792 756 // t.Repo (string) (string) 793 757 case "repo":
+5 -4
api/atproto/repoapplyWrites.go
··· 19 19 // 20 20 // RECORDTYPE: RepoApplyWrites_Create 21 21 type RepoApplyWrites_Create struct { 22 - LexiconTypeID string `json:"$type,const=com.atproto.repo.applyWrites#create" cborgen:"$type,const=com.atproto.repo.applyWrites#create"` 23 - Collection string `json:"collection" cborgen:"collection"` 24 - Rkey *string `json:"rkey,omitempty" cborgen:"rkey,omitempty"` 25 - Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` 22 + LexiconTypeID string `json:"$type,const=com.atproto.repo.applyWrites#create" cborgen:"$type,const=com.atproto.repo.applyWrites#create"` 23 + Collection string `json:"collection" cborgen:"collection"` 24 + // rkey: NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility. 25 + Rkey *string `json:"rkey,omitempty" cborgen:"rkey,omitempty"` 26 + Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` 26 27 } 27 28 28 29 // RepoApplyWrites_CreateResult is a "createResult" in the com.atproto.repo.applyWrites schema.
+26 -12
api/atproto/syncsubscribeRepos.go
··· 26 26 // Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature. 27 27 type SyncSubscribeRepos_Commit struct { 28 28 Blobs []util.LexLink `json:"blobs" cborgen:"blobs"` 29 - // blocks: CAR file containing relevant blocks, as a diff since the previous repo state. 29 + // blocks: CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list. 30 30 Blocks util.LexBytes `json:"blocks,omitempty" cborgen:"blocks,omitempty"` 31 31 // commit: Repo commit object CID. 32 - Commit util.LexLink `json:"commit" cborgen:"commit"` 33 - // prevData 34 - PrevData *util.LexLink `json:"prevData,omitempty" cborgen:"prevData,omitempty"` 35 - Ops []*SyncSubscribeRepos_RepoOp `json:"ops" cborgen:"ops"` 36 - // prev: DEPRECATED -- unused. WARNING -- nullable and optional; stick with optional to ensure golang interoperability. 37 - Prev *util.LexLink `json:"prev" cborgen:"prev"` 32 + Commit util.LexLink `json:"commit" cborgen:"commit"` 33 + Ops []*SyncSubscribeRepos_RepoOp `json:"ops" cborgen:"ops"` 34 + // prevData: The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose. 35 + PrevData *util.LexLink `json:"prevData,omitempty" cborgen:"prevData,omitempty"` 38 36 // rebase: DEPRECATED -- unused 39 37 Rebase bool `json:"rebase" cborgen:"rebase"` 40 - // repo: The repo this event comes from. 38 + // repo: The repo this event comes from. Note that all other message types name this field 'did'. 41 39 Repo string `json:"repo" cborgen:"repo"` 42 40 // rev: The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event. 43 41 Rev string `json:"rev" cborgen:"rev"` ··· 47 45 Since *string `json:"since" cborgen:"since"` 48 46 // time: Timestamp of when this message was originally broadcast. 49 47 Time string `json:"time" cborgen:"time"` 50 - // tooBig: Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data. 48 + // tooBig: DEPRECATED -- replaced by #sync event and data limits. Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data. 51 49 TooBig bool `json:"tooBig" cborgen:"tooBig"` 52 50 } 53 51 ··· 94 92 type SyncSubscribeRepos_RepoOp struct { 95 93 Action string `json:"action" cborgen:"action"` 96 94 // cid: For creates and updates, the new record CID. For deletions, null. 97 - Cid *util.LexLink `json:"cid" cborgen:"cid"` 98 - // prev 95 + Cid *util.LexLink `json:"cid" cborgen:"cid"` 96 + Path string `json:"path" cborgen:"path"` 97 + // prev: For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined. 99 98 Prev *util.LexLink `json:"prev,omitempty" cborgen:"prev,omitempty"` 100 - Path string `json:"path" cborgen:"path"` 99 + } 100 + 101 + // SyncSubscribeRepos_Sync is a "sync" in the com.atproto.sync.subscribeRepos schema. 102 + // 103 + // Updates the repo to a new state, without necessarily including that state on the firehose. Used to recover from broken commit streams, data loss incidents, or in situations where upstream host does not know recent state of the repository. 104 + type SyncSubscribeRepos_Sync struct { 105 + // blocks: CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'. 106 + Blocks util.LexBytes `json:"blocks,omitempty" cborgen:"blocks,omitempty"` 107 + // did: The account this repo event corresponds to. Must match that in the commit object. 108 + Did string `json:"did" cborgen:"did"` 109 + // rev: The rev of the commit. This value must match that in the commit object. 110 + Rev string `json:"rev" cborgen:"rev"` 111 + // seq: The stream sequence number of this message. 112 + Seq int64 `json:"seq" cborgen:"seq"` 113 + // time: Timestamp of when this message was originally broadcast. 114 + Time string `json:"time" cborgen:"time"` 101 115 } 102 116 103 117 // SyncSubscribeRepos_Tombstone is a "tombstone" in the com.atproto.sync.subscribeRepos schema.
+32
api/chat/convoacceptConvo.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.convo.acceptConvo 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ConvoAcceptConvo_Input is the input argument to a chat.bsky.convo.acceptConvo call. 14 + type ConvoAcceptConvo_Input struct { 15 + ConvoId string `json:"convoId" cborgen:"convoId"` 16 + } 17 + 18 + // ConvoAcceptConvo_Output is the output of a chat.bsky.convo.acceptConvo call. 19 + type ConvoAcceptConvo_Output struct { 20 + // rev: Rev when the convo was accepted. If not present, the convo was already accepted. 21 + Rev *string `json:"rev,omitempty" cborgen:"rev,omitempty"` 22 + } 23 + 24 + // ConvoAcceptConvo calls the XRPC method "chat.bsky.convo.acceptConvo". 25 + func ConvoAcceptConvo(ctx context.Context, c *xrpc.Client, input *ConvoAcceptConvo_Input) (*ConvoAcceptConvo_Output, error) { 26 + var out ConvoAcceptConvo_Output 27 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "chat.bsky.convo.acceptConvo", nil, input, &out); err != nil { 28 + return nil, err 29 + } 30 + 31 + return &out, nil 32 + }
+64 -1
api/chat/convodefs.go
··· 18 18 LastMessage *ConvoDefs_ConvoView_LastMessage `json:"lastMessage,omitempty" cborgen:"lastMessage,omitempty"` 19 19 Members []*ActorDefs_ProfileViewBasic `json:"members" cborgen:"members"` 20 20 Muted bool `json:"muted" cborgen:"muted"` 21 - Opened *bool `json:"opened,omitempty" cborgen:"opened,omitempty"` 22 21 Rev string `json:"rev" cborgen:"rev"` 22 + Status *string `json:"status,omitempty" cborgen:"status,omitempty"` 23 23 UnreadCount int64 `json:"unreadCount" cborgen:"unreadCount"` 24 24 } 25 25 ··· 67 67 Rev string `json:"rev" cborgen:"rev"` 68 68 Sender *ConvoDefs_MessageViewSender `json:"sender" cborgen:"sender"` 69 69 SentAt string `json:"sentAt" cborgen:"sentAt"` 70 + } 71 + 72 + // ConvoDefs_LogAcceptConvo is a "logAcceptConvo" in the chat.bsky.convo.defs schema. 73 + // 74 + // RECORDTYPE: ConvoDefs_LogAcceptConvo 75 + type ConvoDefs_LogAcceptConvo struct { 76 + LexiconTypeID string `json:"$type,const=chat.bsky.convo.defs#logAcceptConvo" cborgen:"$type,const=chat.bsky.convo.defs#logAcceptConvo"` 77 + ConvoId string `json:"convoId" cborgen:"convoId"` 78 + Rev string `json:"rev" cborgen:"rev"` 70 79 } 71 80 72 81 // ConvoDefs_LogBeginConvo is a "logBeginConvo" in the chat.bsky.convo.defs schema. ··· 175 184 LexiconTypeID string `json:"$type,const=chat.bsky.convo.defs#logLeaveConvo" cborgen:"$type,const=chat.bsky.convo.defs#logLeaveConvo"` 176 185 ConvoId string `json:"convoId" cborgen:"convoId"` 177 186 Rev string `json:"rev" cborgen:"rev"` 187 + } 188 + 189 + // ConvoDefs_LogMuteConvo is a "logMuteConvo" in the chat.bsky.convo.defs schema. 190 + type ConvoDefs_LogMuteConvo struct { 191 + ConvoId string `json:"convoId" cborgen:"convoId"` 192 + Rev string `json:"rev" cborgen:"rev"` 193 + } 194 + 195 + // ConvoDefs_LogReadMessage is a "logReadMessage" in the chat.bsky.convo.defs schema. 196 + type ConvoDefs_LogReadMessage struct { 197 + ConvoId string `json:"convoId" cborgen:"convoId"` 198 + Message *ConvoDefs_LogReadMessage_Message `json:"message" cborgen:"message"` 199 + Rev string `json:"rev" cborgen:"rev"` 200 + } 201 + 202 + type ConvoDefs_LogReadMessage_Message struct { 203 + ConvoDefs_MessageView *ConvoDefs_MessageView 204 + ConvoDefs_DeletedMessageView *ConvoDefs_DeletedMessageView 205 + } 206 + 207 + func (t *ConvoDefs_LogReadMessage_Message) MarshalJSON() ([]byte, error) { 208 + if t.ConvoDefs_MessageView != nil { 209 + t.ConvoDefs_MessageView.LexiconTypeID = "chat.bsky.convo.defs#messageView" 210 + return json.Marshal(t.ConvoDefs_MessageView) 211 + } 212 + if t.ConvoDefs_DeletedMessageView != nil { 213 + t.ConvoDefs_DeletedMessageView.LexiconTypeID = "chat.bsky.convo.defs#deletedMessageView" 214 + return json.Marshal(t.ConvoDefs_DeletedMessageView) 215 + } 216 + return nil, fmt.Errorf("cannot marshal empty enum") 217 + } 218 + func (t *ConvoDefs_LogReadMessage_Message) UnmarshalJSON(b []byte) error { 219 + typ, err := util.TypeExtract(b) 220 + if err != nil { 221 + return err 222 + } 223 + 224 + switch typ { 225 + case "chat.bsky.convo.defs#messageView": 226 + t.ConvoDefs_MessageView = new(ConvoDefs_MessageView) 227 + return json.Unmarshal(b, t.ConvoDefs_MessageView) 228 + case "chat.bsky.convo.defs#deletedMessageView": 229 + t.ConvoDefs_DeletedMessageView = new(ConvoDefs_DeletedMessageView) 230 + return json.Unmarshal(b, t.ConvoDefs_DeletedMessageView) 231 + 232 + default: 233 + return nil 234 + } 235 + } 236 + 237 + // ConvoDefs_LogUnmuteConvo is a "logUnmuteConvo" in the chat.bsky.convo.defs schema. 238 + type ConvoDefs_LogUnmuteConvo struct { 239 + ConvoId string `json:"convoId" cborgen:"convoId"` 240 + Rev string `json:"rev" cborgen:"rev"` 178 241 } 179 242 180 243 // ConvoDefs_MessageInput is the input argument to a chat.bsky.convo.defs call.
+31
api/chat/convogetConvoAvailability.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package chat 4 + 5 + // schema: chat.bsky.convo.getConvoAvailability 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ConvoGetConvoAvailability_Output is the output of a chat.bsky.convo.getConvoAvailability call. 14 + type ConvoGetConvoAvailability_Output struct { 15 + CanChat bool `json:"canChat" cborgen:"canChat"` 16 + Convo *ConvoDefs_ConvoView `json:"convo,omitempty" cborgen:"convo,omitempty"` 17 + } 18 + 19 + // ConvoGetConvoAvailability calls the XRPC method "chat.bsky.convo.getConvoAvailability". 20 + func ConvoGetConvoAvailability(ctx context.Context, c *xrpc.Client, members []string) (*ConvoGetConvoAvailability_Output, error) { 21 + var out ConvoGetConvoAvailability_Output 22 + 23 + params := map[string]interface{}{ 24 + "members": members, 25 + } 26 + if err := c.Do(ctx, xrpc.Query, "", "chat.bsky.convo.getConvoAvailability", params, nil, &out); err != nil { 27 + return nil, err 28 + } 29 + 30 + return &out, nil 31 + }
+8
api/chat/convogetLog.go
··· 21 21 22 22 type ConvoGetLog_Output_Logs_Elem struct { 23 23 ConvoDefs_LogBeginConvo *ConvoDefs_LogBeginConvo 24 + ConvoDefs_LogAcceptConvo *ConvoDefs_LogAcceptConvo 24 25 ConvoDefs_LogLeaveConvo *ConvoDefs_LogLeaveConvo 25 26 ConvoDefs_LogCreateMessage *ConvoDefs_LogCreateMessage 26 27 ConvoDefs_LogDeleteMessage *ConvoDefs_LogDeleteMessage ··· 30 31 if t.ConvoDefs_LogBeginConvo != nil { 31 32 t.ConvoDefs_LogBeginConvo.LexiconTypeID = "chat.bsky.convo.defs#logBeginConvo" 32 33 return json.Marshal(t.ConvoDefs_LogBeginConvo) 34 + } 35 + if t.ConvoDefs_LogAcceptConvo != nil { 36 + t.ConvoDefs_LogAcceptConvo.LexiconTypeID = "chat.bsky.convo.defs#logAcceptConvo" 37 + return json.Marshal(t.ConvoDefs_LogAcceptConvo) 33 38 } 34 39 if t.ConvoDefs_LogLeaveConvo != nil { 35 40 t.ConvoDefs_LogLeaveConvo.LexiconTypeID = "chat.bsky.convo.defs#logLeaveConvo" ··· 55 60 case "chat.bsky.convo.defs#logBeginConvo": 56 61 t.ConvoDefs_LogBeginConvo = new(ConvoDefs_LogBeginConvo) 57 62 return json.Unmarshal(b, t.ConvoDefs_LogBeginConvo) 63 + case "chat.bsky.convo.defs#logAcceptConvo": 64 + t.ConvoDefs_LogAcceptConvo = new(ConvoDefs_LogAcceptConvo) 65 + return json.Unmarshal(b, t.ConvoDefs_LogAcceptConvo) 58 66 case "chat.bsky.convo.defs#logLeaveConvo": 59 67 t.ConvoDefs_LogLeaveConvo = new(ConvoDefs_LogLeaveConvo) 60 68 return json.Unmarshal(b, t.ConvoDefs_LogLeaveConvo)
+5 -3
api/chat/convolistConvos.go
··· 17 17 } 18 18 19 19 // ConvoListConvos calls the XRPC method "chat.bsky.convo.listConvos". 20 - func ConvoListConvos(ctx context.Context, c *xrpc.Client, cursor string, limit int64) (*ConvoListConvos_Output, error) { 20 + func ConvoListConvos(ctx context.Context, c *xrpc.Client, cursor string, limit int64, readState string, status string) (*ConvoListConvos_Output, error) { 21 21 var out ConvoListConvos_Output 22 22 23 23 params := map[string]interface{}{ 24 - "cursor": cursor, 25 - "limit": limit, 24 + "cursor": cursor, 25 + "limit": limit, 26 + "readState": readState, 27 + "status": status, 26 28 } 27 29 if err := c.Do(ctx, xrpc.Query, "", "chat.bsky.convo.listConvos", params, nil, &out); err != nil { 28 30 return nil, err
+8
api/ozone/moderationemitEvent.go
··· 36 36 ModerationDefs_ModEventReverseTakedown *ModerationDefs_ModEventReverseTakedown 37 37 ModerationDefs_ModEventResolveAppeal *ModerationDefs_ModEventResolveAppeal 38 38 ModerationDefs_ModEventEmail *ModerationDefs_ModEventEmail 39 + ModerationDefs_ModEventDivert *ModerationDefs_ModEventDivert 39 40 ModerationDefs_ModEventTag *ModerationDefs_ModEventTag 40 41 ModerationDefs_AccountEvent *ModerationDefs_AccountEvent 41 42 ModerationDefs_IdentityEvent *ModerationDefs_IdentityEvent ··· 95 96 if t.ModerationDefs_ModEventEmail != nil { 96 97 t.ModerationDefs_ModEventEmail.LexiconTypeID = "tools.ozone.moderation.defs#modEventEmail" 97 98 return json.Marshal(t.ModerationDefs_ModEventEmail) 99 + } 100 + if t.ModerationDefs_ModEventDivert != nil { 101 + t.ModerationDefs_ModEventDivert.LexiconTypeID = "tools.ozone.moderation.defs#modEventDivert" 102 + return json.Marshal(t.ModerationDefs_ModEventDivert) 98 103 } 99 104 if t.ModerationDefs_ModEventTag != nil { 100 105 t.ModerationDefs_ModEventTag.LexiconTypeID = "tools.ozone.moderation.defs#modEventTag" ··· 164 169 case "tools.ozone.moderation.defs#modEventEmail": 165 170 t.ModerationDefs_ModEventEmail = new(ModerationDefs_ModEventEmail) 166 171 return json.Unmarshal(b, t.ModerationDefs_ModEventEmail) 172 + case "tools.ozone.moderation.defs#modEventDivert": 173 + t.ModerationDefs_ModEventDivert = new(ModerationDefs_ModEventDivert) 174 + return json.Unmarshal(b, t.ModerationDefs_ModEventDivert) 167 175 case "tools.ozone.moderation.defs#modEventTag": 168 176 t.ModerationDefs_ModEventTag = new(ModerationDefs_ModEventTag) 169 177 return json.Unmarshal(b, t.ModerationDefs_ModEventTag)
+3 -3
bgs/bgs.go
··· 1005 1005 if errors.Is(err, carstore.ErrRepoBaseMismatch) || ipld.IsNotFound(err) { 1006 1006 ai, lerr := bgs.Index.LookupUser(ctx, u.ID) 1007 1007 if lerr != nil { 1008 - log.Warn("failed handling event, no user", "err", err, "pdsHost", host.Host, "seq", evt.Seq, "repo", u.Did, "prev", stringLink(evt.Prev), "commit", evt.Commit.String()) 1008 + log.Warn("failed handling event, no user", "err", err, "pdsHost", host.Host, "seq", evt.Seq, "repo", u.Did, "commit", evt.Commit.String()) 1009 1009 repoCommitsResultCounter.WithLabelValues(host.Host, "nou4").Inc() 1010 1010 return fmt.Errorf("failed to look up user %s (%d) (err case: %s): %w", u.Did, u.ID, err, lerr) 1011 1011 } 1012 1012 1013 1013 span.SetAttributes(attribute.Bool("catchup_queue", true)) 1014 1014 1015 - log.Info("failed handling event, catchup", "err", err, "pdsHost", host.Host, "seq", evt.Seq, "repo", u.Did, "prev", stringLink(evt.Prev), "commit", evt.Commit.String()) 1015 + log.Info("failed handling event, catchup", "err", err, "pdsHost", host.Host, "seq", evt.Seq, "repo", u.Did, "commit", evt.Commit.String()) 1016 1016 repoCommitsResultCounter.WithLabelValues(host.Host, "catchup2").Inc() 1017 1017 return bgs.Index.Crawler.AddToCatchupQueue(ctx, host, ai, evt) 1018 1018 } 1019 1019 1020 - log.Warn("failed handling event", "err", err, "pdsHost", host.Host, "seq", evt.Seq, "repo", u.Did, "prev", stringLink(evt.Prev), "commit", evt.Commit.String()) 1020 + log.Warn("failed handling event", "err", err, "pdsHost", host.Host, "seq", evt.Seq, "repo", u.Did, "commit", evt.Commit.String()) 1021 1021 repoCommitsResultCounter.WithLabelValues(host.Host, "err").Inc() 1022 1022 return fmt.Errorf("handle user event failed: %w", err) 1023 1023 }
+6
cmd/gosky/debug.go
··· 222 222 fmt.Printf("\nEvent at sequence %d had an invalid repo slice: %s\n", evt.Seq, err) 223 223 return nil 224 224 } else { 225 + _ = r 226 + /* "prev" is no longer included in #commit messages 225 227 prev, err := r.PrevCommit(ctx) 226 228 if err != nil { 227 229 return err ··· 239 241 if !evt.Rebase && cs != es { 240 242 fmt.Printf("\nEvent at sequence %d has mismatch between slice prev and struct prev: %s != %s\n", evt.Seq, prev, evt.Prev) 241 243 } 244 + */ 242 245 } 243 246 } 244 247 ··· 345 348 346 349 for i, ev := range slice { 347 350 if ev.Commit == event.Commit { 351 + _ = pll 352 + /* TODO: prev is no longer included in #commit messages; could use prevData or rev? 348 353 if pll(ev.Prev) != pll(event.Prev) { 349 354 // same commit different prev?? 350 355 return nil, fmt.Errorf("matched event with same commit but different prev: (%d) %d - %d", n, ev.Seq, event.Seq) 351 356 } 357 + */ 352 358 } 353 359 354 360 if i != 0 {
+1 -5
cmd/gosky/main.go
··· 254 254 } 255 255 fmt.Println(string(b)) 256 256 } else { 257 - pstr := "<nil>" 258 - if evt.Prev != nil && evt.Prev.Defined() { 259 - pstr = evt.Prev.String() 260 - } 261 257 var handle string 262 258 if resolveHandles { 263 259 h, err := resolveDid(ctx, evt.Repo) ··· 267 263 handle = h 268 264 } 269 265 } 270 - fmt.Printf("(%d) RepoAppend: %s %s (%s -> %s)\n", evt.Seq, evt.Repo, handle, pstr, evt.Commit.String()) 266 + fmt.Printf("(%d) RepoAppend: %s %s (%s)\n", evt.Seq, evt.Repo, handle, evt.Commit.String()) 271 267 272 268 if unpack { 273 269 recs, err := unpackRecords(evt.Blocks, evt.Ops)
+1 -1
cmd/gosky/streamdiff.go
··· 141 141 } 142 142 143 143 func sameCommit(a, b *comatproto.SyncSubscribeRepos_Commit) bool { 144 - return a.Repo == b.Repo && cidStr(a.Prev) == cidStr(b.Prev) 144 + return a.Repo == b.Repo && a.Rev == b.Rev 145 145 } 146 146 147 147 func findEvt(evt *events.XRPCStreamEvent, list []*events.XRPCStreamEvent) int {
-1
cmd/supercollider/main.go
··· 599 599 if err := s.Events.AddEvent(ctx, &events.XRPCStreamEvent{ 600 600 RepoCommit: &comatproto.SyncSubscribeRepos_Commit{ 601 601 Repo: s.Dids[evt.User-1], 602 - Prev: (*lexutil.LexLink)(evt.OldRoot), 603 602 Blocks: evt.RepoSlice, 604 603 Commit: lexutil.LexLink(evt.NewRoot), 605 604 Time: time.Now().Format(util.ISO8601),
+1 -13
events/dbpersist.go
··· 332 332 return nil, err 333 333 } 334 334 335 - var prev *models.DbCID 336 - if evt.Prev != nil && evt.Prev.Defined() { 337 - prev = &models.DbCID{CID: cid.Cid(*evt.Prev)} 338 - } 339 - 340 335 var blobs []byte 341 336 if len(evt.Blobs) > 0 { 342 337 b, err := json.Marshal(evt.Blobs) ··· 353 348 354 349 rer := RepoEventRecord{ 355 350 Commit: &models.DbCID{CID: cid.Cid(evt.Commit)}, 356 - Prev: prev, 351 + //Prev 357 352 Repo: uid, 358 353 Type: "repo_append", // TODO: refactor to "#commit"? can "rebase" come through this path? 359 354 Blobs: blobs, ··· 608 603 return nil, err 609 604 } 610 605 611 - var prevCID *lexutil.LexLink 612 - if rer != nil && rer.Prev != nil && rer.Prev.CID.Defined() { 613 - tmp := lexutil.LexLink(rer.Prev.CID) 614 - prevCID = &tmp 615 - } 616 - 617 606 var ops []*comatproto.SyncSubscribeRepos_RepoOp 618 607 if err := json.Unmarshal(rer.Ops, &ops); err != nil { 619 608 return nil, err ··· 623 612 Seq: int64(rer.Seq), 624 613 Repo: did, 625 614 Commit: lexutil.LexLink(rer.Commit.CID), 626 - Prev: prevCID, 627 615 Time: rer.Time.Format(util.ISO8601), 628 616 Blobs: blobCIDs, 629 617 Rebase: rer.Rebase,
-1
indexer/indexer.go
··· 124 124 if err := ix.events.AddEvent(ctx, &events.XRPCStreamEvent{ 125 125 RepoCommit: &comatproto.SyncSubscribeRepos_Commit{ 126 126 Repo: did, 127 - Prev: (*lexutil.LexLink)(evt.OldRoot), 128 127 Blocks: slice, 129 128 Rev: evt.Rev, 130 129 Since: evt.Since,
-1
pds/server.go
··· 236 236 } 237 237 238 238 out := &comatproto.SyncSubscribeRepos_Commit{ 239 - Prev: (*lexutil.LexLink)(evt.OldRoot), 240 239 Blocks: evt.RepoSlice, 241 240 Repo: did, 242 241 Time: time.Now().Format(bsutil.ISO8601),