This seems to sneak past the checks added in 09c14b9dd0cc57594d7f4f5aebacb9151c69eb8c but can cause subtle bugs: ParserOutput::getExtensionData will return a stdClass on the first parser, but when the ParserOutput is fetched from cache (subsequent page visits) the value will be unserialized as an array instead of a class and so the return type of getExtensionData will be different.
Description
Details
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | PRODUCTION ERROR | cscott | T312242 Graph extension: Error: Cannot use object of type stdClass as array | ||
| Declined | PRODUCTION ERROR | None | T312589 Graph is storing a stdClass not a JsonDeserializable | ||
| Resolved | cscott | T313452 Fix JsonCodec to unserialize stdClass objects faithfully | |||
| Open | None | T314338 Re-enable cycle detection |
Event Timeline
Change 812076 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):
[mediawiki/core@master] WIP: ensure that JsonCodec restores stdClass instances as objects not arrays
An alternative (see https://gerrit.wikimedia.org/r/c/mediawiki/core/+/812076) is to fix JsonCodec in core to ensure that stdClass objects are unserialized faithfully (as opposed to as arrays).
Change 818478 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):
[mediawiki/core@master] JsonCodec: add CycleDetector to detect cyclic references
Change 879136 had a related patch set uploaded (by C. Scott Ananian; author: Subramanya Sastry):
[mediawiki/services/parsoid@master] TOCData: workaround for non-recursive JsonCodec
Change 879136 merged by jenkins-bot:
[mediawiki/services/parsoid@master] TOCData: workaround for non-recursive JsonCodec
Change 880501 had a related patch set uploaded (by Arlolra; author: Arlolra):
[mediawiki/vendor@master] Bump parsoid to 0.17.0-a11
Change 880501 merged by jenkins-bot:
[mediawiki/vendor@master] Bump parsoid to 0.17.0-a11
Change 812076 merged by jenkins-bot:
[mediawiki/core@master] JsonCodec: fix en/decoding of nested objects and stdClass objects
The extension TitleIcon has a wrong unserialization since 96e4f5d8402 (more exactly the class MediaWiki\Extension\TitleIcon\Icon): see for instance the patch I am preparing, but the failing tests are independent of the patch and fail exactly when MediaWiki has 96e4f5d8402.
For now I fail to understand if something should be changed to adapt the extension or if there is an issue somewhere.
Change 882192 had a related patch set uploaded (by Seb35; author: Seb35):
[mediawiki/extensions/TitleIcon@master] [WIP] Do not double-unserialize
I remarked there are two unserializations in IconManager, and removing the internal unserialization seems to fix the failing tests.
I’m not very comfortable since I don’t know well the extension, neither the change in the unserialization (an advice from you @cscott would be appreciated), and the logic about TitleIcon’s version versus MediaWiki’s version: if it is correct not do do the internal unserialization in MW 1.40+, either the extension must be marked as 1.40+ in extension.json either a more complex logic must be implemented.
Change 883930 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):
[mediawiki/core@master] json: Dont try to deserialize actual user-land instances
Change 883930 merged by jenkins-bot:
[mediawiki/core@master] json: Dont try to deserialize actual user-land instances
Change 883858 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/TitleIcon@master] Fix broken deserialization from page properties
Change 883858 merged by jenkins-bot:
[mediawiki/extensions/TitleIcon@master] Fix broken deserialization from page properties
Change 882192 abandoned by Seb35:
[mediawiki/extensions/TitleIcon@master] [WIP] Do not double-unserialize
Reason:
Already merged in I969d8c49106202d9eb3c59f3b4e35c3c89d4c0dd in a better form
@cscott Anything left to do on this ticket ? Its not entirely clear to me from the task and the tickets.
Change 932276 had a related patch set uploaded (by Cicalese; author: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/TitleIcon@REL1_39] Fix broken deserialization from page properties
Change 932276 merged by jenkins-bot:
[mediawiki/extensions/TitleIcon@REL1_39] Fix broken deserialization from page properties
@cscott: Removing task assignee as this open task has been assigned for more than two years - See the email sent to task assignee on October 11th.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome! :)
If this task has been resolved in the meantime, or should not be worked on by anybody ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!
Change #1185091 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):
[mediawiki/extensions/GrowthExperiments@master] Convert deprecated JsonDeserializable to JsonCodecable
Change #1185113 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):
[mediawiki/extensions/Translate@master] Convert deprecated JsonDeserializable to JsonCodecable
Change #1185113 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Convert deprecated JsonDeserializable to JsonCodecable
Change #1185091 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] Convert deprecated JsonDeserializable to JsonCodecable
Change #818478 abandoned by Hashar:
[mediawiki/core@master] JsonCodec: add CycleDetector to detect cyclic references
Change #818478 restored by Thcipriani:
[mediawiki/core@master] JsonCodec: add CycleDetector to detect cyclic references