Page MenuHomePhabricator

TranslatableBundleMover: Pass data to job as a serializable object
Open, LowPublic

Description

The TranslatableBundleMover stores information about all the pages to be moved in a PageMoveCollection, which is a list of PageMoveOperation.

When moving the page asynchronously (via a Web request for example), this information needs to be passed to the MoveTranslatableBundleJob. PageMoveCollection and PageMoveOperation are not serializable objects, and hence the information to be passed is converted to multiple arrays and then passed to the job queue.

Initially all the information was passed to the job in a single array. This array contained all the pages that are being moved and their new names but after implementing T62920: Provide option to leave a redirect when moving a translatable page we have another array that contains information about which pages to leave redirects for.

Its a bit of a waste that we are constructing class objects but then throwing that structure away. It would be good to have these classes implement the JsonSerializable object and passed as is to the job queue.

My experience with the JobQueue is that it does not always de-serialize the object when it runs the job. It would be good to either clarify what we need to do to make the process reliable, or add a fallback that checks and performs the de-serialization manually.