@@ -63,7 +63,7 @@ export const getSyncEntities = async <S extends Schema>(
63
63
* @param entityKeyClause - An array of entity key clauses to synchronize.
64
64
* @param limit - The maximum number of events to fetch per request (default: 100).
65
65
* @param logging - Whether to log debug information (default: false).
66
- * @param historical - Whether to fetch and subscribe to historical events (default: true ).
66
+ * @param historical - Whether to fetch and subscribe to historical events (default: false ).
67
67
* @returns A promise that resolves to a subscription for event updates.
68
68
*
69
69
* @example
@@ -158,15 +158,15 @@ export const getEntities = async <S extends Schema>(
158
158
* @param limit - The maximum number of event messages to fetch per request (default: 100).
159
159
* @param clause - An optional clause to filter event messages.
160
160
* @param logging - Whether to log debug information (default: false).
161
- * @param historical - Whether to fetch historical events (default: true ).
161
+ * @param historical - Whether to fetch historical events (default: false ).
162
162
*/
163
163
export const getEvents = async < S extends Schema > (
164
164
client : ToriiClient ,
165
165
components : Component < S , Metadata , undefined > [ ] ,
166
166
limit : number = 100 ,
167
167
clause : Clause | undefined ,
168
168
logging : boolean = false ,
169
- historical : boolean = true
169
+ historical : boolean = false
170
170
) => {
171
171
if ( logging ) console . log ( "Starting getEvents" ) ;
172
172
let offset = 0 ;
@@ -187,7 +187,7 @@ export const getEvents = async <S extends Schema>(
187
187
188
188
setEntities ( entities , components , logging ) ;
189
189
190
- if ( Object . keys ( entities ) . length < limit ) {
190
+ if ( Object . keys ( entities ) . length === 0 ) {
191
191
continueFetching = false ;
192
192
} else {
193
193
offset += limit ;
@@ -301,7 +301,7 @@ export const syncEntities = async <S extends Schema>(
301
301
* @param components - An array of component definitions.
302
302
* @param entityKeyClause - An array of EntityKeysClause to filter entities.
303
303
* @param logging - Whether to log debug information (default: false).
304
- * @param historical - Whether to sync to historical events (default: true ).
304
+ * @param historical - Whether to sync to historical events (default: false ).
305
305
* @returns A promise that resolves with the subscription handler.
306
306
* @example
307
307
* const sync = await syncEvents(client, components, entityKeyClause);
@@ -313,7 +313,7 @@ export const syncEvents = async <S extends Schema>(
313
313
components : Component < S , Metadata , undefined > [ ] ,
314
314
entityKeyClause : EntityKeysClause [ ] ,
315
315
logging : boolean = false ,
316
- historical : boolean = true
316
+ historical : boolean = false
317
317
) => {
318
318
if ( logging ) console . log ( "Starting syncEvents" ) ;
319
319
return await client . onEventMessageUpdated (
0 commit comments