How Do Drafts Work on Confluence

Still need help?

The Atlassian Community is here for you.

Ask the community

Purpose

In order to comprehend how drafts work, you will need to understand the most commonly used keywords across the Confluence community.

Draft - A newly created page which has not been published, or simply a page which has never been published before. For instance, if you create a new page, the button on the bottom-right of the editor will show as 'Publish'.

  • Shared Draft - Draft is shared with other users when collaborative editing feature is enabled.
  • Personal Draft - Draft is saved individually when collaborative editing feature is disabled.

Unpublished Changes - Any edits you have made on a page which have not been saved or updated. In this case, you will see the button on the bottom-right of the editor show as 'Update'.

Please note that a Draft applies to a Page as well as a BlogPost.

Solution

Confluence version 6.0 or later

The Collaborative editing feature was first introduced in Confluence 6.0. When this feature is turned ON, Confluence autosaves both drafts and unpublished changes every 30 seconds as the default interval. Regardless if you were interrupted, navigated away from or accidentally closed the Confluence editor tab, your content is retained for you to resume editing when you're ready. If you would like to save your drafts or unpublished changes, click on the 'Close' button on the bottom-right of the editor and then choose 'Keep draft'.

Once you have any drafts or unpublished changes saved, you will notice the lozenges parked next to the page titles under the 'Recently worked on' page. This only applies to Confluence version 6.4 and above. You should be able to find this tab on the left-hand panel within your dashboard. The 'DRAFT' and 'UNPUBLISHED CHANGES' lozenges are only visible to people who have contributed to the draft or unpublished changes, so you don't have to worry about them distracting your viewers.

If the Collaborative Editing feature is turned OFF, the draft saving mechanism reverts to the previous Confluence behavior as in versions prior to 6.0 as described below.

It is important that all drafts are saved properly (hit the 'Keep Draft' button or close the tab) before disabling the Collaborative Editing feature. Otherwise, all of these unsaved drafts or changes will be lost.

What happens on the database (version 6.0+)

Every time a draft or unpublished changes is saved, a new entry is added into the CONTENT table with the following parameters.

Column NameValue
CONTENTTYPEPAGE
CONTENT_STATUSdraft
Confluence Database Entry

Collaborative Editing uses Synchrony service which handles the content merging (Content Reconciliation Job) of several edits into a single shared draft. This draft is saved in the database as shown in the table below. Synchrony will also keep another copy in the Synchrony caches.

> SELECT * FROM CONTENT WHERE CONTENTTYPE = 'PAGE' AND CONTENT_STATUS = 'draft';
+-----------+------------------+-------------+---------------------------+---------------------------+---------+----------------------------------+---------------------+----------------------------------+---------------------+----------------+---------+----------------+--------+---------+----------------+----------+-----------+-----------+-----------+------------+-------------+---------------+-----------+------------------+-----------------+----------+
| CONTENTID | HIBERNATEVERSION | CONTENTTYPE | TITLE                     | LOWERTITLE                | VERSION | CREATOR                          | CREATIONDATE        | LASTMODIFIER                     | LASTMODDATE         | VERSIONCOMMENT | PREVVER | CONTENT_STATUS | PAGEID | SPACEID | CHILD_POSITION | PARENTID | MESSAGEID | PLUGINKEY | PLUGINVER | PARENTCCID | DRAFTPAGEID | DRAFTSPACEKEY | DRAFTTYPE | DRAFTPAGEVERSION | PARENTCOMMENTID | USERNAME |
+-----------+------------------+-------------+---------------------------+---------------------------+---------+----------------------------------+---------------------+----------------------------------+---------------------+----------------+---------+----------------+--------+---------+----------------+----------+-----------+-----------+-----------+------------+-------------+---------------+-----------+------------------+-----------------+----------+
|   1048611 |                3 | PAGE        | Collaborative Editing On  | collaborative editing on  |       1 | 2c95b0a25ea426cb015ea43397740000 | 2017-09-27 14:18:02 | 2c95b0a25ea426cb015ea43397740000 | 2017-09-27 14:18:07 |                | 1048596 | draft          |   NULL |   98306 |           NULL |     NULL | NULL      | NULL      | NULL      |       NULL | NULL        | NULL          | NULL      |             NULL |            NULL | NULL     |
+-----------+------------------+-------------+---------------------------+---------------------------+---------+----------------------------------+---------------------+----------------------------------+---------------------+----------------+---------+----------------+--------+---------+----------------+----------+-----------+-----------+-----------+------------+-------------+---------------+-----------+------------------+-----------------+----------+
1 row in set (0.01 sec)
Synchrony Cache

Synchrony caches are stored under the CONTENTPROPERTIES table. Three entries are created with the relative property name e.g. shared-idsync-revsync-rev-source. If the Collaborative Editing feature is disabled, both the property sync-rev and sync-rev-source will be removed from the CONTENTPROPERTIES table.

> SELECT * FROM CONTENTPROPERTIES WHERE CONTENTID IN (SELECT CONTENTID FROM CONTENT WHERE CONTENTTYPE = 'PAGE' AND CONTENT_STATUS = 'draft');
+------------+-----------------+--------------------------------------+---------+---------+-----------+
| PROPERTYID | PROPERTYNAME    | STRINGVAL                            | LONGVAL | DATEVAL | CONTENTID |
+------------+-----------------+--------------------------------------+---------+---------+-----------+
|    1015974 | share-id        | 9e1230b3-4d0f-42bb-8257-5f070e6762fc |    NULL | NULL    |   1048611 |
|    1015977 | sync-rev        | 0.xefUXHu673S4z0mOnue4JN0.2          |    NULL | NULL    |   1048611 |
|    1015978 | sync-rev-source | synchrony                            |    NULL | NULL    |   1048611 |
+------------+-----------------+--------------------------------------+---------+---------+-----------+
3 rows in set (0.01 sec)

The Content Reconciliation Job is responsible for merging pages/drafts and making sure the database contents are in sync with the contents of Synchrony caches. The definition of the STRINGVAL value is described below.

synchrony

Content has been reconciled and drafts are synced between the database the Synchrony cache.

synchrony-recovery

Draft is out of sync in Synchrony cache. This forces Synchrony to fetch the latest content from the database and update its cache.

synchrony-ack

Draft is up to date and content reconciliation is not needed. This is mainly for performance improvement to avoid running Content Reconciliation on an already updated draft.

Prior to Confluence 6.0

Confluence Collaborative Editing feature was first introduced in Confluence 6.0. Prior to Confluence version 6.0, the draft feature works differently and the keyword has a different meaning. It does not automatically save any newly created page which has not been published. Only edits you have made on a page which has not been saved or updated are saved every 30 seconds (the default interval). These edits are named 'draft'.

Prior to Confluence version 6.0, draft works differently and the keyword has a different meaning.

What happens on the database (< version 6.0)

The draft is saved differently when the Collaborative Editing feature is disabled. The saving mechanism will be reverted and the draft will be saved as one entry under the CONTENT table with the following parameters.

CONTENTTYPE : DRAFT

CONTENT_STATUS : current

Confluence Database Entry

This is how the entry will look like on the database:

> SELECT * FROM CONTENT WHERE CONTENTTYPE = 'DRAFT';
+-----------+------------------+-------------+---------------------------+---------------------------+---------+----------------------------------+---------------------+--------------+---------------------+----------------+---------+----------------+--------+---------+----------------+----------+-----------+-----------+-----------+------------+-------------+---------------+-----------+------------------+-----------------+----------+
| CONTENTID | HIBERNATEVERSION | CONTENTTYPE | TITLE                     | LOWERTITLE                | VERSION | CREATOR                          | CREATIONDATE        | LASTMODIFIER | LASTMODDATE         | VERSIONCOMMENT | PREVVER | CONTENT_STATUS | PAGEID | SPACEID | CHILD_POSITION | PARENTID | MESSAGEID | PLUGINKEY | PLUGINVER | PARENTCCID | DRAFTPAGEID | DRAFTSPACEKEY | DRAFTTYPE | DRAFTPAGEVERSION | PARENTCOMMENTID | USERNAME |
+-----------+------------------+-------------+---------------------------+---------------------------+---------+----------------------------------+---------------------+--------------+---------------------+----------------+---------+----------------+--------+---------+----------------+----------+-----------+-----------+-----------+------------+-------------+---------------+-----------+------------------+-----------------+----------+
|   1048613 |                1 | DRAFT       | Collaborative Editing Off | collaborative editing off |       1 | 2c95b0a25ea426cb015ea43397740000 | 2017-09-27 14:57:41 | NULL         | 2017-09-27 14:57:41 |                |    NULL | current        |   NULL |    NULL |           NULL |     NULL | NULL      | NULL      | NULL      |       NULL | 1048596     | SAN           | page      |                3 |            NULL | NULL     |
+-----------+------------------+-------------+---------------------------+---------------------------+---------+----------------------------------+---------------------+--------------+---------------------+----------------+---------+----------------+--------+---------+----------------+----------+-----------+-----------+-----------+------------+-------------+---------------+-----------+------------------+-----------------+----------+
1 row in set (0.00 sec)


How to Delete Drafts

Unfortunately, it is not possible for Confluence administrators to view and delete all drafts from all users at the moment. We already have a suggestion raised under  CONFSERVER-35921 - Getting issue details... STATUS . Meanwhile, users can review and discard their drafts via the Drafts page by clicking the 'Profile Picture' at the top-right corner of the application. Click on Discard next to the draft you wish to delete.

Collaborative Editing Feature is Enabled

Only the person who originally created the shared draft can delete it. For example, if user Sean first edited a Confluence page titled 'Awesome Article' and then user Robert joined in at later time and edit the same page simultaneously. Edits made by both users are saved under the same shared draft. However, only user Sean can delete the shared draft and if he deletes it, any unpublished changes made by user Robert on the shared draft will be deleted as well.


On the other hand, personal drafts are saved individually for each user if the collaborative editing feature is disabled.

Known Bugs & Improvements

  1. CONFSERVER-53589 - Getting issue details... STATUS
  2. CONFSERVER-51812 - Getting issue details... STATUS


Description

In order to comprehend how drafts work, you will need to understand the most commonly used keywords across the Confluence community.

Draft - A newly created page which has not been published, or simply a page which has never been published before. For instance, if you create a new page, the button on the bottom-right of the editor will show as 'Publish'.

ProductConfluence
PlatformServer, Cloud
Last modified on Sep 6, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.