Page MenuHomePhabricator

Wikibase: Special:EntityData compression encoding issues in local dev env
Closed, ResolvedPublic

Description

Wikibase Entity compression issues are occurring in a freshly installed minimal development environment, which causes browser tests to fail as well as disables users from adding Statements to Items.

Steps to reproduce:

  1. Create a new local MediaWiki dev env, by following the instructions in MediaWiki-Docker > Quickstart and DEVELOPERS.md.
  2. Clone and install the Wikibase extension according to instructions in Wikibase/Installation up until the end of the "Run maintenance scripts" section.
NOTE: Make sure to follow the instructions for both repo and client, so that at the end of the process the only lines in your LocalSettings.php - apart from the auto-generated lines from the mediawiki installation process - are the ones below.
LocalSettings.php
// Autogenerated code ...

wfLoadSkin( 'Vector' );

wfLoadExtension( 'WikibaseRepository', "$IP/extensions/Wikibase/extension-repo.json" );
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
wfLoadExtension( 'WikibaseClient', "$IP/extensions/Wikibase/extension-client.json" );
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";
  1. Go to Special:NewItem in your local wiki and add an item to test on
  2. Go to Special:EntityData/Q1.json.

Current behavior:

Returned entity data is compressed and unreadable (unparseable). This breaks the Wikibase Item UI (users are not able to add statements) and consequently the browser tests fail when run locally.

Screenshot_from_2021-05-06_17-22-08.png (977×1 px, 174 KB)

Expected behavior:

Entity data is returned either with proper content-encoding header or in json, so that the browser is able to parse the response body.

Screenshot_from_2021-05-06_17-28-00.png (980×1 px, 201 KB)

Hints:

  • Install fresh-node in order to run browser tests, and run the following commands from the mediawiki root to reproduce the error without worrying about browser version etc. The test should pass when the Entity data is correctly encoded.
Terminal
$ fresh-node -env -net
$ cd extensions/Wikibase
$ npm ci
$ npm run selenium-test:repo -- --spec repo/tests/selenium/specs/item.js

Event Timeline

Addshore renamed this task from Wikibase: EntityData compression encoding issues in local dev env to Wikibase: Special:EntityData compression encoding issues in local dev env.May 6 2021, 3:53 PM

Change 701899 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/Wikibase@master] EntityDataRequestHandler: Remove ob_clean() call

https://gerrit.wikimedia.org/r/701899

Change 701899 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] EntityDataRequestHandler: Remove ob_clean() call

https://gerrit.wikimedia.org/r/701899

This should be fixed now. @ItamarWMDE do you mind verifying in your environment?

Change 702825 had a related patch set uploaded (by Addshore; author: Kosta Harlan):

[mediawiki/extensions/Wikibase@REL1_35] EntityDataRequestHandler: Remove ob_clean() call

https://gerrit.wikimedia.org/r/702825

Change 702946 had a related patch set uploaded (by Addshore; author: Kosta Harlan):

[mediawiki/extensions/Wikibase@REL1_36] EntityDataRequestHandler: Remove ob_clean() call

https://gerrit.wikimedia.org/r/702946

Hi @kostajh Sorry it took me so long to respond, on Holiday at the moment. I did check it now and looks like it works! Thank you :)

Change 702825 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@REL1_35] EntityDataRequestHandler: Remove ob_clean() call

https://gerrit.wikimedia.org/r/702825

Hi @kostajh Sorry it took me so long to respond, on Holiday at the moment. I did check it now and looks like it works! Thank you :)

Thanks for confirming!

Change 702946 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@REL1_36] EntityDataRequestHandler: Remove ob_clean() call

https://gerrit.wikimedia.org/r/702946