Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3401785
D8026.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D8026.diff
View Options
diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js
--- a/lib/reducers/message-reducer.js
+++ b/lib/reducers/message-reducer.js
@@ -1496,6 +1496,19 @@
thumbnailEncryptionKey,
});
replaced = true;
+ } else if (mediaUpdate.id) {
+ const { id: newID } = mediaUpdate;
+ // branching for Flow
+ if (singleMedia.type === 'photo') {
+ media.push({ ...singleMedia, id: newID });
+ } else if (singleMedia.type === 'video') {
+ media.push({ ...singleMedia, id: newID });
+ } else if (singleMedia.type === 'encrypted_photo') {
+ media.push({ ...singleMedia, id: newID });
+ } else if (singleMedia.type === 'encrypted_video') {
+ media.push({ ...singleMedia, id: newID });
+ }
+ replaced = true;
}
}
updatedMessage = { ...message, media };
diff --git a/web/input/input-state-container.react.js b/web/input/input-state-container.react.js
--- a/web/input/input-state-container.react.js
+++ b/web/input/input-state-container.react.js
@@ -1017,9 +1017,7 @@
type: updateMultimediaMessageMediaActionType,
payload: {
messageID: uploadAfterPreload.messageID,
- currentMediaID: uploadAfterPreload.serverID
- ? uploadAfterPreload.serverID
- : uploadAfterPreload.localID,
+ currentMediaID: result.id ?? uploadAfterPreload.localID,
mediaUpdate,
},
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 1:52 PM (1 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2611900
Default Alt Text
D8026.diff (1 KB)
Attached To
Mode
D8026: [web] Fix "invariant violation" for encrypted uploads
Attached
Detach File
Event Timeline
Log In to Comment