Page MenuHomePhabricator

Enabling Flow after disabling it does nothing
Open, Needs TriagePublic

Description

I disabled Flow on my talk page on Wikidata via settings (beta) and then Flow talk page manager moved my talk page to "User talk:Stryn/Flow Archive 1" and "User talk:Stryn/Archive 4" (wikitext talk page) to "User talk:Stryn".
Then I enabled Flow again, and Flow talk page manager moved my talk page to "User talk:Stryn/Archive 4" with a reason "Move wikitext page to make room for a discussion board."

However now there's not Flow in use on my talk page even though Flow is enabled on my settings. I tried to move "User talk:Stryn/Flow Archive 1" to "User talk:Stryn" but only a Flow bot can do that.

Event Timeline

Stryn raised the priority of this task from to Needs Triage.
Stryn updated the task description. (Show Details)
Stryn added a project: StructuredDiscussions.
Stryn subscribed.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald Transcript

I tried to move User talk:Stryn/Flow Archive 1 back to User talk:Stryn (log) but now the moved page is giving me an exception. I'm investigating that now.

It still has the old title somehow:

> $title = Title::newFromText( 'User_talk:Stryn' );                                                    
> $page = WikiPage::factory( $title );                                                                 
> $content = $page->getContent();                                                                      
> $workflow = Flow\Container::get( 'storage' )->getStorage( 'Workflow' )->get( $content->getWorkflowId() );

> var_export( $workflow->getArticleTitle()->getPrefixedText() );
'User talk:Stryn/Flow Archive 1'

But not in the database:

> var_export( $content->getWorkflowId()->getHex() );
'053c6603decda85caf7a72'
> var_export( $workflow->getId()->getHex() );
'053c6603decda85caf7a72'
mysql:research@x1-analytics-slave [flowdb]> SELECT HEX(workflow_id), workflow_type, workflow_namespace, workflow_title_text FROM flow_workflow WHERE workflow_wiki = 'wikidatawiki' AND LOWER(HEX(workflow_id)) = '053c6603decda85caf7a72';
+------------------------+---------------+--------------------+---------------------+
| HEX(workflow_id)       | workflow_type | workflow_namespace | workflow_title_text |
+------------------------+---------------+--------------------+---------------------+
| 053C6603DECDA85CAF7A72 | discussion    |                  3 | Stryn               |
+------------------------+---------------+--------------------+---------------------+
1 row in set (0.00 sec)
> $index = Flow\Container::get( 'storage.workflow.indexes.primary' );

> var_export( $index->find( array( 'workflow_id' => $content->getWorkflowId() ) ) );
array (
  0 => 
  array (
    'workflow_type' => 'discussion',
    'workflow_wiki' => 'wikidatawiki',
    'workflow_page_id' => 22544316,
    'workflow_namespace' => 3,
    'workflow_title_text' => 'Stryn/Flow_Archive_1',
    'workflow_lock_state' => 0,
    'workflow_last_update_timestamp' => '20151122175538',
    'workflow_name' => '',
    'workflow_id' => 'smrg72yhbv8lwy9e',
  ),
)

It looks like it's not updating the UniqueFeatureIndex. I wonder if this worked before or not.

Attempted to replicate a simpler version of what should have happened (the UniqueFeatureIndex should have updated from an onAfterUpdate resulting from https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FFlow.git/master/includes%2FBoardMover.php#L85 (the ->put):

I don't have any leads on what might have caused it (no sign of bad compacting, etc.):

P2347

The workaround is opening an eval.php session on the specific wiki, using terbium:

mwscript eval.php --wiki=wikidatawiki

The workaround script is:

1$titleText = 'User_talk:Stryn';
2$title = Title::newFromText( $titleText );
3
4$page = WikiPage::factory( $title );
5$content = $page->getContent();
6$workflowId = $content->getWorkflowId();
7
8$index = Flow\Container::get( 'storage.workflow.indexes.primary' );
9
10$cacheKeyMethod = new ReflectionMethod( 'Flow\Data\Index\Featureindex::cacheKey' );
11$cacheKeyMethod->setAccessible( true );
12$cacheKey = $cacheKeyMethod->invoke( $index, array( 'workflow_id' => $workflowId ) );
13
14var_export( $cacheKey );
15
16var_export( $wgMemc->get( $cacheKey ) );
17
18$wgMemc->delete( $cacheKey );
19
20var_export( $wgMemc->get( $cacheKey ) );

Result:

1mattflaschen@terbium:~$ mwscript eval.php --wiki=wikidatawiki
2> $titleText = 'User_talk:Stryn';
3
4> $title = Title::newFromText( $titleText );
5
6>
7
8> $page = WikiPage::factory( $title );
9
10> $content = $page->getContent();
11
12> $workflowId = $content->getWorkflowId();
13
14>
15
16> $index = Flow\Container::get( 'storage.workflow.indexes.primary' );
17
18>
19
20> $cacheKeyMethod = new ReflectionMethod( 'Flow\Data\Index\FeatureIndex::cacheKey' );
21
22> $cacheKeyMethod->setAccessible( true );
23
24> $cacheKey = $cacheKeyMethod->invoke( $index, array( 'workflow_id' => $workflowId ) );
25
26>
27
28> var_export( $cacheKey );
29'flowdb:flow_workflow%3Av2%3Apk:4465fd521b6c4d09dd6e9687702ac53c:4.8'
30>
31
32> var_export( $wgMemc->get( $cacheKey ) );
33array (
34 0 =>
35 array (
36 'workflow_type' => 'discussion',
37 'workflow_wiki' => 'wikidatawiki',
38 'workflow_page_id' => 22544316,
39 'workflow_namespace' => 3,
40 'workflow_title_text' => 'Stryn/Flow_Archive_1',
41 'workflow_lock_state' => 0,
42 'workflow_last_update_timestamp' => '20151122175538',
43 'workflow_name' => '',
44 ),
45)
46>
47
48> $wgMemc->delete( $cacheKey );
49
50> var_export( $wgMemc->get( $cacheKey ) );
51false

I tried to move User talk:Stryn/Flow Archive 1 back to User talk:Stryn (log) but now the moved page is giving me an exception. I'm investigating that now.

Thanks to Matt's work above this page is fixed now.

I see there are also other problems on enabling Flow on user talk pages:

*Flow is not there:
https://www.wikidata.org/w/index.php?title=User_talk:Airon90
(Flow talk page manager moved page User talk:Airon90 to User talk:Airon90/Archive 1 without leaving a redirect: Move wikitext page to make room for a discussion board.)

*Flow enabled, but it does nothing:
https://www.wikidata.org/wiki/Topic:Suf3iqc70f51jkla

*Flow enabled, but it does nothing:
https://www.wikidata.org/wiki/Topic:Suf3iqc70f51jkla

This one was created, it was just s/f/low.