@ibgib/core-gib 0.1.27 → 0.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ import { SyncStage } from "../sync-constants.mjs";
6
6
  import { SyncMode, SyncConflictStrategy, } from "../sync-types.mjs";
7
7
  import { SYNC_SAGA_MSG_ATOM } from "./sync-saga-message-constants.mjs";
8
8
  import type { getDeltaDependencyGraph } from '../../common/other/graph-helper.mjs';
9
+ import type { SyncSagaContextIbGib_V1, SyncSagaContextData_V1 } from '../sync-saga-context/sync-saga-context-types.mjs';
9
10
 
10
11
  export interface SyncSagaMessageIb_V1 {
11
12
  atom: typeof SYNC_SAGA_MSG_ATOM;
@@ -145,28 +146,16 @@ export interface SyncSagaConflictInfo {
145
146
  export interface SyncSagaMessageAckData_V1 extends SyncSagaMessageData_V1 {
146
147
  stage: typeof SyncStage.ack;
147
148
  deltaRequestAddrInfos: SyncSagaRequestAddrInfo[];
148
- pushOfferInfos: SyncSagaPushOfferInfo[];
149
149
  /**
150
- * Map of group keys (TJP addr/constant addr) to list of known addresses
151
- * in that timeline.
152
- *
153
- * This will be used by Sender to calculate differential payloads. So
154
- * when the sender goes to get the dependency graph of its tip ibgib,
155
- * it can skip all of the addrs in this.
156
- *
157
- * For example, say sender has A^5 and receiver only has A^3. Sender
158
- * will see in this map { [A^0]: [A^0, A^1, A^2, A^3] } and know that
159
- * it needs all of the dependencies of A^5 (including A^4), but it does
160
- * NOT need to send A^0-A^3 (and dependencies) because receiver already has
161
- * these.
150
+ * Infos regarding ibgibs that the receiver (generator of this ack)
151
+ * knows/believes that the sender does NOT have (after looking at knowledge
152
+ * vector of sender).
162
153
  *
163
- * ## notes
154
+ * This includes addrs that will correspond to the context.payloadAddrsDomain
164
155
  *
165
- * I dislike this name in my rewrite/cleanup of this algorithm. However, I'm
166
- * keeping it and am using it right now in handleInitFrame for including
167
- * the receiver's latest addr/tip for the deltaReqAddrs. But really, I should
156
+ * ## note
168
157
  */
169
- // knowledgeVector?: { [tjpAddr: string]: string[] };
158
+ pushOfferInfos: SyncSagaPushOfferInfo[];
170
159
  /**
171
160
  * List of identified conflicts.
172
161
  *
@@ -194,6 +183,12 @@ export interface SyncSagaMessageDeltaData_V1 extends SyncSagaMessageData_V1 {
194
183
  /**
195
184
  * Domain ibgib addresses (actual user data being synced).
196
185
  * These go to tempSpace ONLY until final commit.
186
+ *
187
+ * NOTE: There is also a payloadAddrsDomain on the actual context itself on
188
+ * {@link SyncSagaContextData_V1}.
189
+ * NOTE: There is also payload info in {@link SyncSagaMessageAckData_V1}
190
+ * in {@link SyncSagaMessageAckData_V1.pushOfferInfos}. Not quite as elegant
191
+ * as I want it to be but there ya go.
197
192
  */
198
193
  payloadAddrsDomain?: string[];
199
194
  }
@@ -9,7 +9,7 @@ import { IbGibSpaceAny } from "../witness/space/space-base-v1.mjs";
9
9
  import { MetaspaceService } from "../witness/space/metaspace/metaspace-types.mjs";
10
10
  import { SyncPeerWitness } from "./sync-peer/sync-peer-types.mjs";
11
11
  import { FlatIbGibGraph } from "../common/other/graph-types.mjs";
12
- import { SyncSagaConflictInfo } from "./sync-saga-message/sync-saga-message-types.mjs";
12
+ import { SyncSagaConflictInfo, SyncSagaMessageIbGib_V1 } from "./sync-saga-message/sync-saga-message-types.mjs";
13
13
 
14
14
 
15
15
  // #region SyncMode
@@ -94,14 +94,13 @@ export function isValidSyncExecutionContext(executionContext: string): execution
94
94
  export interface NextSagaFrameInfo_Frame {
95
95
  frame: SyncIbGib_V1;
96
96
  payloadIbGibsDomain?: IbGib_V1[];
97
- // conflictInfos?: SyncSagaConflictInfo;
98
- responseWasNull?: undefined;
97
+ sagaComplete?: undefined;
99
98
  }
100
- export interface NextSagaFrameInfo_Null {
99
+ export interface NextSagaFrameInfo_SagaComplete {
101
100
  frame?: never;
102
101
  payloadIbGibsDomain?: never;
103
102
  conflictInfos?: never;
104
- responseWasNull: true;
103
+ sagaComplete: true;
105
104
  }
106
105
  /**
107
106
  * Result of handling a saga frame.
@@ -112,7 +111,7 @@ export interface NextSagaFrameInfo_Null {
112
111
  * defined, thus the discriminated union type.
113
112
  */
114
113
  export type NextSagaFrameInfo =
115
- NextSagaFrameInfo_Frame | NextSagaFrameInfo_Null;
114
+ NextSagaFrameInfo_Frame | NextSagaFrameInfo_SagaComplete;
116
115
 
117
116
 
118
117
  export interface HandleSagaResponseContextResult_Base {
@@ -207,7 +206,8 @@ export interface SyncSagaInfo {
207
206
 
208
207
  export interface SyncSagaFrameDependencyGraph {
209
208
  sagaIbGib: SyncIbGib_V1;
210
- msgStones: IbGib_V1[];
209
+ // msgStones: IbGib_V1[];
210
+ msgStones: SyncSagaMessageIbGib_V1[];
211
211
  identities: KeystoneIbGib_V1[];
212
212
  }
213
213