Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added instanceids for push user and stream #1224

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading