Page MenuHomePhabricator

Add the ability to return the parsed block reason to API:Userinfo
Closed, DeclinedPublic

Description

API:Userinfo should have an option or property to return the parsed wikitext message rather than the raw wikitext.

The parsed message would only parse the links just like the display on Special:BlockList

Event Timeline

dbarratt triaged this task as Medium priority.May 11 2018, 7:23 PM
dbarratt created this task.

Should be both, really. See T191558 for list=blocks.

Should be both, really. See T191558 for list=blocks.

Agree. Alternatively, we should probably just replace the usage in MinervaNeue with something like T194585 anyways.

dbarratt updated the task description. (Show Details)
dbarratt renamed this task from Add the ability to return the parsed block reason to API:Userinfo or API:Blocks to Add the ability to return the parsed block reason to API:Userinfo.May 13 2018, 4:35 AM
dbarratt updated the task description. (Show Details)
Anomie subscribed.

See also T191939: How to deal with blocked messages on client that require advanced parsing?, there's already ambiguity between when a block reason should be interpreted as full-featured wikitext versus comment-style limited wikitext. In either case, action=parse already exists (use its summary parameter to parse as comment-style limited wikitext).

Personally, I'd lean towards deprecating and removing the "parsedcomment" properties from other API modules as well.

See also T191939: How to deal with blocked messages on client that require advanced parsing?, there's already ambiguity between when a block reason should be interpreted as full-featured wikitext versus comment-style limited wikitext. In either case, action=parse already exists (use its summary parameter to parse as comment-style limited wikitext).

So what you're saying is, is that the preferred way of parsing wikitext on the client is to use the API to do so? Is it acceptable to make another round trip to do this? I suppose it's not a huge deal with HTTP/2. What do you think @Jdlrobson?

Personally, I'd lean towards deprecating and removing the "parsedcomment" properties from other API modules as well.

Ironically, this is actually a good use case for GraphQL which supports arguments, so basically we could have a reason field which would have an argument where you could specify the type of parsing that you want (full, comment, etc.), but the default would be none.

Might be worth creating an experimental extension or something that would wrap the Action API in GraphQL just as a way to see if it resolves some of these use cases (thinking out-loud here, ha).

So what you're saying is, is that the preferred way of parsing wikitext on the client is to use the API to do so? Is it acceptable to make another round trip to do this? I suppose it's not a huge deal with HTTP/2. What do you think @Jdlrobson?

Let's follow up at T191558 (since this ticket is closed).

Ironically, this is actually a good use case for GraphQL which supports arguments, so basically we could have a reason field which would have an argument where you could specify the type of parsing that you want (full, comment, etc.), but the default would be none.

@dbarratt: This isn't really the appropriate venue for discussing ideas like this. Let's try to stay focused on the immediate problems :)

@dbarratt: This isn't really the appropriate venue for discussing ideas like this. Let's try to stay focused on the immediate problems :)

ha! you got it. I should probably stop thinking out-loud. :)

Vvjjkkii renamed this task from Add the ability to return the parsed block reason to API:Userinfo to p3caaaaaaa.Jul 1 2018, 1:10 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii raised the priority of this task from Medium to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from p3caaaaaaa to Add the ability to return the parsed block reason to API:Userinfo.Jul 2 2018, 5:46 AM
CommunityTechBot closed this task as Declined.
CommunityTechBot lowered the priority of this task from High to Medium.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.