MCPcopy Create free account
hub / github.com/blues/note / hubNoteboxChanges

Function hubNoteboxChanges

lib/hubreq.go:875–901  ·  view source on GitHub ↗

Notebox Changes

(ctx context.Context, session *HubSession, req notehubMessage, rsp *notehubMessage, event EventFunc)

Source from the content-addressed store, hash-verified

873
874// Notebox Changes
875func hubNoteboxChanges(ctx context.Context, session *HubSession, req notehubMessage, rsp *notehubMessage, event EventFunc) (err error) {
876 // Open the box
877 box, _, _, err2 := openHubNoteboxForDevice(ctx, session, req.DeviceUID, req.DeviceSN, req.ProductUID, req.DeviceEndpointID, event)
878 if err2 != nil {
879 err = err2
880 return
881 }
882
883 // Get the tracked changes
884 chgfile, _, totalChanges, _, since, until, err4 := box.GetChanges(req.DeviceEndpointID, defaultMaxGetNoteboxChangesBatchSize)
885 if err4 != nil {
886 err = err4
887 box.Close(ctx)
888 return
889 }
890
891 // Return the results
892 rsp.Since = since
893 rsp.Until = until
894 rsp.MaxChanges = int32(totalChanges)
895 err = rsp.SetNotefile(chgfile)
896
897 // Done
898 box.Close(ctx)
899
900 return
901}
902
903// Notebox Merge
904func hubNoteboxMerge(ctx context.Context, session *HubSession, req notehubMessage, rsp *notehubMessage, event EventFunc) (err error) {

Callers 1

processRequestFunction · 0.85

Calls 4

openHubNoteboxForDeviceFunction · 0.85
SetNotefileMethod · 0.80
GetChangesMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected