When the storage format of a page embeds an image that is not yet attached to the page, the image will still be rendered as "Unknown attachment" in the page editor although the image has been added to the page beforehand.
- Ensure Collaborative Editing is switched on.
- Create a page with this storage format.
- The page displays "Unknown attachment".
- Via '...' > 'Attachments', just insert an attachment 'test.jpg' into the page. You'll see that the page now contains 1 attachment, which is 'test.jpg'.
- View the page you first created and the image is now there.
- Edit the page.
The image would still be displayed.
If a script that uses REST API to automate the process of creating/copying pages and uploading attachments to it is being used, please remember to follow the order below in the creation of the page to avoid being affected by this bug:
- create a page in Confluence
- add the attachments to this created page
- update the page with the expected content, in the storage format, using REST API
Leave an inline comment on any text of the page. You can delete or resolve it immediately afterwards. Attachment upload doesn't change page storage format, so the code path that triggers sending view page updates to synchrony is not used. Leaving an inline comment triggers the path, pushing updated editor format data into synchrony.
- Open the editor for the affected page
- Click on the ellipsis button on the bottom right corner of the screen (besides the Close button)
- Click on revert back to the last published version
- Check if the attachment appears on the editor now
The problem is caused by the draft entry on the DB being created before the attachment exists. The application replaces the attachment name with plugins/servlet/confluence/placeholder/unknown-attachment?locale=en_US&version=2 in that situation. Following the steps from Option 2 creates a new draft entry for this page, so it is able to recognize the attachment.