Skip to content

Commit

Permalink
fix(stream): fix inconsistent timestamp type in sdk & socket
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur12-1610 committed Apr 15, 2024
1 parent d30e095 commit 4e5bacb
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions packages/restapi/src/lib/pushstream/DataModifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class DataModifier {
): JoinGroupEvent {
const baseEventData: JoinGroupEvent = {
origin: data.messageOrigin,
timestamp: data.timestamp,
timestamp: data.timestamp.toString(),
chatId: data.chatId,
from: data.from,
to: data.to,
Expand All @@ -78,7 +78,7 @@ export class DataModifier {
): LeaveGroupEvent {
const baseEventData: LeaveGroupEvent = {
origin: data.messageOrigin,
timestamp: data.timestamp,
timestamp: data.timestamp.toString(),
chatId: data.chatId,
from: data.from,
to: data.to,
Expand All @@ -96,7 +96,7 @@ export class DataModifier {
private static mapToRequestEvent(data: any, includeRaw: boolean): any {
const eventData: RequestEvent = {
origin: data.messageOrigin,
timestamp: data.timestamp,
timestamp: data.timestamp.toString(),
chatId: data.chatId,
from: data.from,
to: data.to,
Expand All @@ -116,7 +116,7 @@ export class DataModifier {
// Whatever the structure of your RemoveEvent, modify accordingly
const eventData: RemoveEvent = {
origin: data.messageOrigin,
timestamp: data.timestamp,
timestamp: data.timestamp.toString(),
chatId: data.chatId,
from: data.from,
to: data.to,
Expand All @@ -133,7 +133,7 @@ export class DataModifier {
// Whatever the structure of your RemoveEvent, modify accordingly
const eventData: RoleEvent = {
origin: data.messageOrigin,
timestamp: data.timestamp,
timestamp: data.timestamp.toString(),
chatId: data.chatId,
from: data.from,
to: data.to,
Expand Down Expand Up @@ -186,7 +186,7 @@ export class DataModifier {
const groupEvent: any = {
event: eventType,
origin: incomingData.messageOrigin,
timestamp: incomingData.timestamp,
timestamp: incomingData.timestamp.toString(),
chatId: incomingData.chatId,
from: incomingData.from,
meta,
Expand Down Expand Up @@ -330,7 +330,7 @@ export class DataModifier {
const notificationEvent: NotificationEvent = {
event: notificationEventType,
origin: origin,
timestamp: data.epoch,
timestamp: data.epoch.toString(),
from: data.sender,
to: recipients,
notifID: data.payload_id.toString(),
Expand Down Expand Up @@ -515,7 +515,7 @@ export class DataModifier {
const baseEventData: BaseEventData = {
event: data.eventType,
origin: data.messageOrigin,
timestamp: data.timestamp,
timestamp: data.timestamp.toString(),
spaceId: data.spaceId,
from: data.spaceCreator,
meta: {
Expand Down Expand Up @@ -560,7 +560,7 @@ export class DataModifier {
const baseEventData: BaseEventData = {
event: data.eventType,
origin: data.messageOrigin,
timestamp: data.timestamp,
timestamp: data.timestamp.toString(),
spaceId: data.spaceId,
from: data.spaceCreator,
meta: {
Expand All @@ -585,7 +585,7 @@ export class DataModifier {
private static mapToRequestSpaceEvent(data: any, includeRaw: boolean): any {
const eventData: SpaceRequestEvent = {
origin: data.messageOrigin,
timestamp: data.timestamp,
timestamp: data.timestamp.toString(),
spaceId: data.spaceId,
from: data.from,
to: data.to,
Expand Down Expand Up @@ -614,7 +614,7 @@ export class DataModifier {
const baseEventData: BaseEventData = {
event: 'request',
origin: data.messageOrigin === 'other' ? 'self' : 'other',
timestamp: data.timestamp,
timestamp: data.timestamp.toString(),
spaceId: data.chatId,
from: data.fromCAIP10,
to: [data.toCAIP10],
Expand Down Expand Up @@ -675,7 +675,7 @@ export class DataModifier {

const eventData: BaseEventData = {
origin: data.messageOrigin,
timestamp: data.timestamp,
timestamp: data.timestamp.toString(),
spaceId: data.spaceId,
from: data.from,
to: data.to,
Expand Down Expand Up @@ -703,7 +703,7 @@ export class DataModifier {

const eventData: BaseEventData = {
origin: data.messageOrigin,
timestamp: data.timestamp,
timestamp: data.timestamp.toString(),
spaceId: data.spaceId,
from: data.from,
to: data.to,
Expand Down Expand Up @@ -731,7 +731,7 @@ export class DataModifier {

const eventData: BaseEventData = {
origin: data.messageOrigin,
timestamp: data.timestamp,
timestamp: data.timestamp.toString(),
spaceId: data.spaceId,
from: data.from,
to: data.to,
Expand Down Expand Up @@ -759,7 +759,7 @@ export class DataModifier {

const eventData: BaseEventData = {
origin: data.messageOrigin,
timestamp: data.timestamp,
timestamp: data.timestamp.toString(),
spaceId: data.spaceId,
from: data.from,
to: null,
Expand Down Expand Up @@ -787,7 +787,7 @@ export class DataModifier {

const eventData: BaseEventData = {
origin: data.messageOrigin,
timestamp: data.timestamp,
timestamp: data.timestamp.toString(),
spaceId: data.spaceId,
from: data.from,
to: null,
Expand Down Expand Up @@ -856,7 +856,7 @@ export class DataModifier {
const videoEvent: VideoEvent = {
event: videoEventType,
origin: origin,
timestamp: data.epoch,
timestamp: data.epoch.toString(),
peerInfo,
};

Expand Down

0 comments on commit 4e5bacb

Please sign in to comment.