Skip to content

Commit

Permalink
fix: added instanceids for push user and stream (#1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammeds1992 authored Apr 12, 2024
1 parent dfc1f05 commit 34263c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/restapi/src/lib/pushapi/PushAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { Video } from './video';
import { isValidCAIP10NFTAddress } from '../helpers';
import { LRUCache } from 'lru-cache';
import { cache } from '../helpers/cache';
import { v4 as uuidv4 } from 'uuid';

export class PushAPI {
private signer?: SignerType;
Expand All @@ -44,7 +45,7 @@ export class PushAPI {
// Notification
public channel!: Channel;
public notification!: Notification;

public pushUserInstanceId: string;
// error object to maintain errors and warnings
public errors: { type: 'WARN' | 'ERROR'; message: string }[];

Expand All @@ -70,7 +71,7 @@ export class PushAPI {
// Instantiate the notification classes
this.channel = new Channel(this.signer, this.env, this.account);
this.notification = new Notification(this.signer, this.env, this.account);

this.pushUserInstanceId = uuidv4();
this.cache = cache;

// Initialize the instances of the four classes
Expand Down
5 changes: 3 additions & 2 deletions packages/restapi/src/lib/pushstream/PushStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Chat } from '../pushapi/chat';
import { ProgressHookType, SignerType } from '../types';
import { ALPHA_FEATURE_CONFIG } from '../config';
import { ADDITIONAL_META_TYPE } from '../payloads';

import { v4 as uuidv4 } from 'uuid';
export class PushStream extends EventEmitter {
private pushChatSocket: any;
private pushNotificationSocket: any;
Expand All @@ -28,7 +28,7 @@ export class PushStream extends EventEmitter {
private chatInstance: Chat;
private listen: STREAM[];
private disconnected: boolean;

public streamInstanceId: string;
constructor(
account: string,
private _listen: STREAM[],
Expand All @@ -45,6 +45,7 @@ export class PushStream extends EventEmitter {
this.options = options;
this.listen = _listen;
this.disconnected = false;
this.streamInstanceId = uuidv4();
this.chatInstance = new Chat(
this.account,
this.options.env as ENV,
Expand Down

0 comments on commit 34263c9

Please sign in to comment.