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

feat: expose StoreAction in relation to multiplayer history #7898

Merged
merged 3 commits into from Apr 22, 2024

Conversation

Mrazator
Copy link
Collaborator

@Mrazator Mrazator commented Apr 16, 2024

Introduced breaking change in updateScene API due to the added Store component as part of the #7348. Specifically, sceneData property commitToHistory: boolean was replaced with storeAction: StoreActionType.

image

Additional small improvements:

  • Stabilises Store methods, internal API & public API (i.e. introduced commit)
  • Avoids potential concurrency issues due to updateScene modifying store before already scheduled store actions execute
  • Fixes slight issues with AppState in shared scenes (collab)

Copy link

vercel bot commented Apr 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
excalidraw ✅ Ready (Inspect) Visit Preview Apr 22, 2024 9:21am
excalidraw-package-example ✅ Ready (Inspect) Visit Preview Apr 22, 2024 9:21am
excalidraw-package-example-with-nextjs ✅ Ready (Inspect) Visit Preview Apr 22, 2024 9:21am
1 Ignored Deployment
Name Status Preview Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Apr 22, 2024 9:21am

Copy link

github-actions bot commented Apr 16, 2024

Coverage Report

Status Category Percentage Covered / Total
🔴 Lines 65.4% (🎯 70%) 50860 / 77759
🔴 Statements 65.4% (🎯 70%) 50860 / 77759
🔴 Functions 66.51% (🎯 68%) 1557 / 2341
🟢 Branches 80.98% (🎯 70%) 6243 / 7709
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
excalidraw-app/App.tsx 53.15% 61.11% 19.44% 53.15% 137-146, 191-226, 228-250, 253-284, 287-292, 295-296, 326, 357-358, 360-374, 378-381, 385-396, 399-411, 425-447, 455-514, 518-519, 522-531, 554-564, 588-612, 622-659, 662-672, 685-698, 707-713, 730-736, 759-779, 800, 826-832, 841-894, 898-900, 903-907, 916-927, 931-933, 951-955, 971-977, 996-997, 1014-1019, 1028-1033, 1053-1058, 1067-1072, 1075-1080, 1090-1098, 1103-1106
excalidraw-app/collab/Collab.tsx 49.34% 60.97% 46.66% 49.34% 145-151, 157-165, 182, 188, 238-240, 242-244, 255-256, 259-273, 289-290, 292-314, 318-363, 366-378, 381-406, 409-427, 442-443, 449, 473-479, 493-496, 501-502, 528-627, 631-638, 644-649, 660-704, 707-727, 730-741, 745-753, 756-769, 772-790, 793-798, 801-802, 810-822, 825-840, 856-863, 868-878, 881-882, 916-923, 943-947, 952-955, 959-962, 970-972
excalidraw-app/collab/Portal.tsx 55.6% 60.86% 54.54% 55.6% 43-46, 49-53, 56, 63-73, 78-80, 90-100, 111-116, 124-128, 141-142, 179-193, 196-217, 220-241, 244-247
excalidraw-app/data/FileManager.ts 43.44% 41.66% 36.36% 43.44% 52-58, 61-62, 76-77, 79-81, 88-96, 99-100, 105-136, 146-153, 163-164, 169-173, 177-218, 221-244
excalidraw-app/data/index.ts 57.39% 57.89% 72.72% 57.39% 48-49, 139-141, 150-151, 168-197, 200-239, 251-258, 280-338
packages/excalidraw/index.tsx 80.63% 89.47% 80% 80.63% 93-97, 153-202
packages/excalidraw/store.ts 96.87% 96.2% 95.83% 96.87% 228-234, 262-263, 304-305, 332-333
packages/excalidraw/types.ts 100% 100% 100% 100%
packages/excalidraw/actions/actionHistory.tsx 97.45% 75% 100% 97.45% 39-41
packages/excalidraw/actions/types.ts 0% 0% 0% 0% 1-199
packages/excalidraw/components/App.tsx 69.29% 76.28% 68.04% 69.29% 475-476, 583-592, 691-692, 710-711, 735-795, 798-804, 807-810, 813-889, 892-911, 914-919, 927-937, 939-940, 945-946, 950-952, 966, 973-1234, 1294-1295, 1306-1307, 1335-1337, 1347-1392, 1418, 1428, 1435-1438, 1447-1451, 1482-1483, 1567-1577, 1582-1597, 1601-1648, 1719-1724, 1753-1758, 1761-1791, 1799-1824, 1827-1836, 1839-1951, 1954-1962, 1971-1984, 1987-2013, 2016-2087, 2090-2131, 2183-2184, 2198-2199, 2226-2227, 2231-2232, 2252-2260, 2265-2278, 2284-2285, 2290-2298, 2300-2308, 2320, 2361-2362, 2384-2385, 2392, 2461-2463, 2466-2471, 2476-2477, 2515-2523, 2528-2537, 2575-2576, 2660-2661, 2665, 2668-2669, 2677-2680, 2689-2702, 2708-2711, 2714, 2716-2717, 2724-2725, 2731-2732, 2735-2736, 2744-2745, 2748-2749, 2752-2755, 2766-2774, 2779-2780, 2830-2831, 2845-2851, 2857-2865, 2869-2877, 2881-2882, 2885-2918, 2921-2933, 2944-2945, 2956-2957, 2974-2978, 2982-2985, 2992-2994, 3012-3019, 3022, 3024-3029, 3033-3035, 3056-3057, 3064-3066, 3068-3091, 3117, 3123, 3179-3180, 3197-3199, 3221-3222, 3228-3231, 3237-3318, 3390-3391, 3450, 3460-3478, 3481-3487, 3490-3491, 3497-3510, 3596-3597, 3599-3600, 3605-3607, 3615-3616, 3639-3653, 3658-3677, 3729-3730, 3802, 3811-3812, 3814-3821, 3836-3840, 3851-3852, 3855-3859, 3861-3862, 3864-3867, 3892-3893, 3902-3904, 3906, 3984-3987, 4009-4011, 4021-4022, 4024-4044, 4047-4053, 4070-4073, 4079-4082, 4092-4099, 4110, 4138-4142, 4146, 4151-4152, 4157-4161, 4189-4190, 4193-4194, 4197-4198, 4206-4210, 4215-4216, 4222-4232, 4237-4264, 4269-4280, 4347, 4373-4374, 4439-4445, 4528, 4553, 4579-4581, 4648-4649, 4664-4665, 4835-4836, 4839-4840, 4848, 4897-4901, 4952-4959, 4965-5031, 5075, 5124, 5151, 5158-5159, 5168-5171, 5202, 5250-5253, 5256-5262, 5264-5267, 5282-5291, 5294-5295, 5377-5378, 5381, 5383-5388, 5394-5396, 5398, 5407, 5429-5434, 5436-5439, 5443-5444, 5454-5554, 5558-5559, 5574-5575, 5608-5609, 5636-5637, 5670-5697, 5704-5705, 5727-5728, 5747, 5749-5792, 5797-5798, 5800-5801, 5817-5818, 5824-5825, 5829-5832, 5835-5836, 5851-5878, 5886-5887, 5891-5894, 5896-5900, 5918-5922, 5968-5973, 5975-5977, 5993, 5995-6008, 6033-6036, 6080, 6097-6098, 6100-6123, 6138-6139, 6250-6278, 6347-6351, 6375-6376, 6396-6397, 6491, 6497-6498, 6521-6540, 6555, 6683, 6705-6743, 6747-6797, 6812, 6821, 6855-6861, 6876-6878, 7020-7023, 7047-7078, 7091, 7093-7101, 7115, 7117-7125, 7132-7135, 7143-7148, 7175-7176, 7181-7183, 7186-7187, 7212-7213, 7244-7245, 7328-7329, 7378-7391, 7452-7455, 7481-7482, 7518-7519, 7532, 7550-7556, 7563-7566, 7589-7595, 7667, 7673, 7688-7695, 7698-7705, 7761, 7838-7839, 7860-7862, 7865, 7879-7903, 8009-8033, 8043-8082, 8095-8096, 8105-8112, 8126-8139, 8152-8159, 8213-8239, 8241-8242, 8316-8317, 8324, 8326-8362, 8391, 8452, 8481-8483, 8508-8513, 8515-8516, 8521-8523, 8526-8546, 8560-8561, 8567-8576, 8581, 8585-8589, 8598-8602, 8605-8610, 8614-8621, 8651, 8653-8657, 8659-8669, 8685-8687, 8698-8706, 8710-8754, 8757-8828, 8836, 8854-8861, 8863-8879, 8894-8916, 8935-8937, 8982-8983, 9013-9014, 9110-9114, 9116-9132, 9134-9138, 9150-9151, 9161-9177, 9196-9215, 9217-9218, 9245-9246, 9250-9251, 9261, 9263-9266, 9268-9269, 9309, 9330-9331, 9357, 9360, 9401, 9415-9423, 9440-9441, 9473-9476, 9565-9572, 9598-9599, 9640-9694, 9742-9743, 9752-9755, 9760-9761, 9782-9784, 9786-9790, 9828
packages/excalidraw/element/linearElementEditor.ts 77.75% 83.58% 89.18% 77.75% 134, 138-190, 206-207, 211-212, 222-223, 225-245, 271-274, 345-346, 364-373, 386, 404-412, 500-501, 625-626, 639, 663-664, 670-671, 688-723, 818-819, 823-824, 831-832, 838-840, 842-879, 1029-1094, 1108-1115, 1130-1139, 1205-1206, 1247-1248, 1312-1338, 1454-1486
Generated in workflow #2319

@@ -3683,51 +3682,38 @@ class App extends React.Component<AppProps, AppState> {
elements?: SceneData["elements"];
appState?: Pick<AppState, K> | null;
collaborators?: SceneData["collaborators"];
commitToStore?: SceneData["commitToStore"];
storeAction?: SceneData["storeAction"];
Copy link
Member

@dwelle dwelle Apr 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's note the default here? (as a tsdoc /** */ so it shows in intellisense)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, added

Copy link

sentry-io bot commented Apr 25, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ TypeError: Object.hasOwn is not a function isObservedAppState(packages/excalidraw/store) View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants