mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-03 12:42:48 +03:00
eventsource: prevent resetting event id counter
This commit is contained in:
parent
421eef1d19
commit
e5b66e3484
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@urbit/http-api",
|
||||
"version": "2.1.0",
|
||||
"version": "2.1.1",
|
||||
"license": "MIT",
|
||||
"description": "Library to interact with an Urbit ship over HTTP",
|
||||
"repository": {
|
||||
|
@ -235,9 +235,9 @@ export class Urbit {
|
||||
console.log('Received SSE: ', event);
|
||||
}
|
||||
if (!event.id) return;
|
||||
this.lastEventId = parseInt(event.id, 10);
|
||||
if (this.lastEventId - this.lastAcknowledgedEventId > 20) {
|
||||
this.ack(this.lastEventId);
|
||||
const eventId = parseInt(event.id, 10);
|
||||
if (eventId - this.lastAcknowledgedEventId > 20) {
|
||||
this.ack(eventId);
|
||||
}
|
||||
|
||||
if (event.data && JSON.parse(event.data)) {
|
||||
@ -312,7 +312,7 @@ export class Urbit {
|
||||
*
|
||||
*/
|
||||
reset() {
|
||||
if(this.verbose) {
|
||||
if (this.verbose) {
|
||||
console.log('resetting');
|
||||
}
|
||||
this.delete();
|
||||
|
Loading…
Reference in New Issue
Block a user