Discrepancy in page id on preview between different instances

I am developing an add-on with a dynamic macro. When the macro loads, it gets a page attachment that contains the data that is needed to render itself. The attachment is retrieved through a page id that is taken from the context provided through AP navigator.getLocation(). When the macro is rendered in the preview page for the Confluence editor, I am seeing very different behavior on two instances of Confluence. Both are build 1000.1070.1 and both use ACJS 5.0.0-beta.41. However, on one of the instance, the page id returned from navigator is the correct page id and the macro renders correctly, while on the other, the page id is a draft id and the macro cannot render because the id is not correct. Looking at the path on the urls, they are different:

works : /wiki/pages/editpage.action?pageId=23540908
does not work : /wiki/pages/resumedraft.action?draftId=2588866&draftShareId=20929c9d-7cb8-4171-abe0-db2d8a4a5888

This also happend when we pass the page.id context parameter. (In the connect documentation, page.id is marked as depricated, but container.id always returns an emtry string, so we user page.id).

As a side note, there are subtle differences in the look of the pages. On the working instance, the save button says “save” while on the one that uses the draft id, the button says “update”.

Why the difference for two instances that appear to be identical?

The differences in the instances is likely due to partial rollout of new features not related to ACJS. At the time it may have been a roll out of collaborative editing. The different URLs suggest that one is loading the old editor, and one is loading the collaborative editor (/resumedraft).

They should be consistent now, and if you pass the page id in through the URL you should be getting a consistent experience with your macro. Are you still having an issue?

Hi Matt,

Yes, they look consistent now. The issue was originally brought up because we found an issue with history and page preview (from the Confluence page editor) in the new update. In both cases, our dynamic macro is being passed some sort of draft ID, instead of the regular container id, and the provided ID does not allow us to get the content information through the REST API. As a result, our macros do not render in those context. It there a way we can still get the page information in these contexts?

I created a new topic to address the content id issue at Cannot get page context in page preview and history views.