Skip to content
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
6 changes: 6 additions & 0 deletions .changeset/crazy-cities-stand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@pulse-editor/shared-utils": patch
"@pulse-editor/react-api": patch
---

Fix simultaneous messages cause message id conflicts
1 change: 1 addition & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"chubby-insects-shake",
"clean-mangos-swim",
"cold-shrimps-give",
"crazy-cities-stand",
"cruel-waves-double",
"cruel-zoos-play",
"curvy-places-wash",
Expand Down
8 changes: 8 additions & 0 deletions npm-packages/react-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @pulse-editor/react-api

## 0.1.1-alpha.48

### Patch Changes

- Fix simultaneous messages cause message id conflicts
- Updated dependencies
- @pulse-editor/[email protected]

## 0.1.1-alpha.47

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions npm-packages/react-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pulse-editor/react-api",
"version": "0.1.1-alpha.47",
"version": "0.1.1-alpha.48",
"main": "dist/main.js",
"files": [
"dist"
Expand Down Expand Up @@ -38,7 +38,7 @@
"typescript-eslint": "^8.30.1"
},
"peerDependencies": {
"@pulse-editor/shared-utils": "0.1.1-alpha.47",
"@pulse-editor/shared-utils": "0.1.1-alpha.48",
"react": "^19.0.0",
"react-dom": "^19.0.0"
}
Expand Down
1 change: 1 addition & 0 deletions npm-packages/react-api/src/providers/snapshot-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default function SnapshotProvider({
const { states } = message.payload;

// Update all states in the context
console.log("Restoring snapshot states:", states);
setStates((prev) => ({ ...states }));
},
],
Expand Down
6 changes: 6 additions & 0 deletions npm-packages/shared-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @pulse-editor/shared-utils

## 0.1.1-alpha.48

### Patch Changes

- Fix simultaneous messages cause message id conflicts

## 0.1.1-alpha.47

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion npm-packages/shared-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pulse-editor/shared-utils",
"version": "0.1.1-alpha.47",
"version": "0.1.1-alpha.48",
"main": "dist/main.js",
"files": [
"dist"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export class InterModuleCommunication {
type !== IMCMessageTypeEnum.SignalGetWindowId
) {
console.warn(
`Duplicate message received with message ID: ${messageId}. Ignoring this message. Message: ${JSON.stringify(
`[${
this.thisWindowId
}]: Duplicate message received with message ID: ${messageId}. Ignoring this message. Message: ${JSON.stringify(
event.data
)}`
);
Expand Down
3 changes: 2 additions & 1 deletion npm-packages/shared-utils/src/imc/message-sender.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { v4 } from "uuid";
import { IMCMessage, IMCMessageTypeEnum } from "../types/types";

export class MessageSender {
Expand Down Expand Up @@ -25,7 +26,7 @@ export class MessageSender {
abortSignal?: AbortSignal
): Promise<any> {
// Generate a unique id for the message using timestamp
const id = new Date().getTime().toString();
const id = v4() + new Date().getTime().toString();
const message: IMCMessage = {
id,
type: handlingType,
Expand Down
Loading