Handle non-defined property updates #954
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
publisher: rework page property processing
Calls to
get_page_property
should returnNone
for non-entries on a page. This was the original intent with the implementation, but final tweaks for initial APIv2 support made the default result a partially populated property instance. This commit cleans up this to restore the original intent to have undefined properties returnNone
, as well as updates various locations to use a default property value for each applicable section. Specifically:CB_PROP_KEY
returns a prepared empty value dictionary, since the requests will push up a new property changeNone
populated value to explicitly indicate that the requests should support this type of metadata, as well as that Confluence has reported no value existsNone
, which will be updated with the provided property value for the expected change to the property value.publisher: skip property version bumps for non-populated entries
This extension tracks certain property entries as an indication that a property is supported for this instance (e.g. on Confluence Cloud, a content width property exists, but not on Confluence Server (at this time?)). However, even if we track support, it does not mean that Confluence has reported the property has been defined for a page.
When we publish property updates for a page, we perform a version bump to indicate to Confluence the property is being updated. Although, for non-defined property entries, the value is set to
None
with no version entries. This causes the implementation to fail since there is no version value to bump. This commit corrects this by checking that the previous value does exist before attempting any version bump; otherwise, it treats the property update event as if it was created a new property entry.