[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-02-16 Thread thiemowmde
thiemowmde added a comment. Quick response from a dev who worked with this code back in 2014 and is at least partially responsible for the mess. ️ The formatter options are (mis)used for two, maybe three different purposes. 1. Only very few options are meant to accept values the

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-02-01 Thread ArthurTaylor
ArthurTaylor claimed this task. TASK DETAIL https://phabricator.wikimedia.org/T323778 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: ArthurTaylor Cc: Arian_Bozorg, ArthurTaylor, ItamarWMDE, Michael, Lucas_Werkmeister_WMDE, Aklapper,

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-01-30 Thread ArthurTaylor
ArthurTaylor added a comment. Just to reiterate my perspective here - it would be straightforward to fork DataValues or merge the code into our codebase, tidy up the exception handling and resolve this issue from the tech side. Regardless of what happens with the `options` parameter, it

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-01-30 Thread Lucas_Werkmeister_WMDE
Lucas_Werkmeister_WMDE added a subscriber: Arian_Bozorg. Lucas_Werkmeister_WMDE added a comment. Pinging @Arian_Bozorg for product :) my summary: The `wbformatvalue` API has an `options` parameter that can be used to set various options that affect value formatting. Some of these options

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-01-30 Thread Lucas_Werkmeister_WMDE
Lucas_Werkmeister_WMDE added a comment. In T323778#9498091 , @ArthurTaylor wrote: > @Lucas_Werkmeister_WMDE - Okay. That does sound like a product decision though. Yeah, that’s fair. > Are you against merging the proposed

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-01-30 Thread ArthurTaylor
ArthurTaylor added a comment. @Lucas_Werkmeister_WMDE - Okay. That does sound like a product decision though. Are you against merging the proposed changes to resolve this error before we start the discussion about changing the API? TASK DETAIL https://phabricator.wikimedia.org/T323778

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-01-30 Thread Lucas_Werkmeister_WMDE
Lucas_Werkmeister_WMDE added a comment. (In the longer term, it probably makes sense for us to fork the library, but I don’t think it’s worth it at the moment.) TASK DETAIL https://phabricator.wikimedia.org/T323778 EMAIL PREFERENCES

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-01-30 Thread Lucas_Werkmeister_WMDE
Lucas_Werkmeister_WMDE added a comment. According to T260553#9498017 , the set of formatting options people actually use, at least via the API, is pretty limited. (According to T323776 , the Lua

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-01-30 Thread ArthurTaylor
ArthurTaylor removed ArthurTaylor as the assignee of this task. TASK DETAIL https://phabricator.wikimedia.org/T323778 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: ArthurTaylor Cc: ArthurTaylor, ItamarWMDE, Michael, Lucas_Werkmeister_WMDE,

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-01-30 Thread ArthurTaylor
ArthurTaylor added a comment. I had a chat with the maintainer of the DataValues library in this pull request . They were not interested in refining the way the library processes errors, so for now the proposed patch just catches raw

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-01-30 Thread gerritbot
gerritbot added a project: Patch-For-Review. TASK DETAIL https://phabricator.wikimedia.org/T323778 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: ArthurTaylor, gerritbot Cc: ArthurTaylor, ItamarWMDE, Michael, Lucas_Werkmeister_WMDE, Aklapper,

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-01-30 Thread gerritbot
gerritbot added a comment. Change 994017 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor): [mediawiki/extensions/Wikibase@master] Catch TypeErrors in value formatters for wbformatvalue https://gerrit.wikimedia.org/r/994017 TASK DETAIL

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-01-24 Thread ArthurTaylor
ArthurTaylor added a comment. Okay. So since the code currently throws an exception in these cases, and the exception is presented to the users in the document response, it seems that catching that in the library and throwing a more specific exception is not a product-relevant change. Let's

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-01-23 Thread Lucas_Werkmeister_WMDE
Lucas_Werkmeister_WMDE added a comment. I guess I should start with what I had in mind in some form – I imagined the implementation would look something like this, repeated a lot of times: diff --git a/src/Formatters/LatLongFormatter.php b/src/Formatters/LatLongFormatter.php index

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-01-23 Thread ArthurTaylor
ArthurTaylor claimed this task. ArthurTaylor edited projects, added Wikidata Dev Team (Wikidata.org Slice); removed Wikidata Dev Team. TASK DETAIL https://phabricator.wikimedia.org/T323778 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: ArthurTaylor

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-01-23 Thread ArthurTaylor
ArthurTaylor added a comment. As I understand your comment, you are not sure what the best approach would be here, but you nevertheless have some opinions about what it might look like and should not look like. If I'm going to pick the ticket up and work on it, it would be helpful for me to

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-01-16 Thread Lucas_Werkmeister_WMDE
Lucas_Werkmeister_WMDE added a comment. In T323778#9441487 , @ArthurTaylor wrote: > My suggested approach would be first to make the libraries themselves robust and prevent them throwing type errors. To do this, I would deprecate the

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2024-01-08 Thread ArthurTaylor
ArthurTaylor added a comment. Had a quick look at this today. It's pretty easy to reproduce the bug with just the library code on its own - see this fork/branch on Github

[Wikidata-bugs] [Maniphest] T323778: [ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors

2023-09-20 Thread ItamarWMDE
ItamarWMDE renamed this task from "[TECH][ACTION-API] Wikibase doesn’t validate formatter options, can crash with different TypeErrors" to "[ACTION-API] [TECH] Wikibase doesn’t validate formatter options, can crash with different TypeErrors". TASK DETAIL