Skip to content

Commit

Permalink
fixed realtime subscriptions auto cancellation to use the proper requ…
Browse files Browse the repository at this point in the history
…estKey param
  • Loading branch information
ganigeorgiev committed Oct 5, 2023
1 parent af593b1 commit 9f6700a
Show file tree
Hide file tree
Showing 18 changed files with 19 additions and 21 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.18.1

- Fixed realtime subscriptions auto cancellation to use the proper `requestKey` param.


## 0.18.0

- Added `pb.backups.upload(data)` action (_available with PocketBase v0.18.0_).
Expand Down
1 change: 0 additions & 1 deletion dist/pocketbase.cjs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ interface LogRequestModel extends BaseModel {
};
}
interface RecordModel extends BaseModel {
[key: string]: any;
collectionId: string;
collectionName: string;
expand?: {
Expand Down
2 changes: 1 addition & 1 deletion dist/pocketbase.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pocketbase.cjs.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/pocketbase.es.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ interface LogRequestModel extends BaseModel {
};
}
interface RecordModel extends BaseModel {
[key: string]: any;
collectionId: string;
collectionName: string;
expand?: {
Expand Down
1 change: 0 additions & 1 deletion dist/pocketbase.es.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ interface LogRequestModel extends BaseModel {
};
}
interface RecordModel extends BaseModel {
[key: string]: any;
collectionId: string;
collectionName: string;
expand?: {
Expand Down
2 changes: 1 addition & 1 deletion dist/pocketbase.es.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pocketbase.es.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pocketbase.es.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pocketbase.es.mjs.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/pocketbase.iife.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ interface LogRequestModel extends BaseModel {
};
}
interface RecordModel extends BaseModel {
[key: string]: any;
collectionId: string;
collectionName: string;
expand?: {
Expand Down
2 changes: 1 addition & 1 deletion dist/pocketbase.iife.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pocketbase.iife.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/pocketbase.umd.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ interface LogRequestModel extends BaseModel {
};
}
interface RecordModel extends BaseModel {
[key: string]: any;
collectionId: string;
collectionName: string;
expand?: {
Expand Down
2 changes: 1 addition & 1 deletion dist/pocketbase.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pocketbase.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.18.0",
"version": "0.18.1",
"name": "pocketbase",
"description": "PocketBase JavaScript SDK",
"author": "Gani Georgiev",
Expand Down
8 changes: 3 additions & 5 deletions src/services/RealtimeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,12 @@ export class RealtimeService extends BaseService {
this.lastSentTopics = this.getNonEmptySubscriptionTopics();

return this.client.send('/api/realtime', {
'method': 'POST',
'body': {
method: 'POST',
body: {
'clientId': this.clientId,
'subscriptions': this.lastSentTopics,
},
'query': {
'requestKey': this.getSubscriptionsCancelKey(),
},
requestKey: this.getSubscriptionsCancelKey(),
}).catch((err) => {
if (err?.isAbort) {
return; // silently ignore aborted pending requests
Expand Down

0 comments on commit 9f6700a

Please sign in to comment.