Homec4science

Post data to the Aphlict server in JSON encoded form.

Authored by Joshua Spence <josh@joshuaspence.com> on Jun 5 2014, 18:47.

Description

Post data to the Aphlict server in JSON encoded form.

Summary:
Ref T4324. Currently, notifications data is POSTed to the Aphlict server in the application/x-www-form-urlencoded format. This works fine for simple data but is problematic for nested data. For example:

array(
  'data' => array(
    'key'  => '6021329908492455737',
    'type' => 'PhabricatorNotificationAdHocFeedStory',
  ),
  'subscribers' => array(
    'PHID-USER-y7ofqm276ejs62yqghge',
  ),
);

Is encoded as data%5Bkey%5D=6021329908492455737&data%5Btype%5D=PhabricatorNotificationAdHocFeedStory&subscribers%5B0%5D=PHID-USER-y7ofqm276ejs62yqghge. This string is then (incorrectly) decoded by querystring.parse as:

> querystring.parse('data%5Bkey%5D=6021329908492455737&data%5Btype%5D=PhabricatorNotificationAdHocFeedStory&subscribers%5B0%5D=PHID-USER-y7ofqm276ejs62yqghge');
{ 'data[key]': '6021329908492455737',
  'data[type]': 'PhabricatorNotificationAdHocFeedStory',
  'subscribers[0]': 'PHID-USER-y7ofqm276ejs62yqghge' }

Test Plan: Sent test notifications from /notification/status/ and verified that the notifications still worked.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T4324

Differential Revision: https://secure.phabricator.com/D9386

Details

Committed
epriestley <git@epriestley.com>Jun 5 2014, 18:47
Pushed
aubortJan 31 2017, 17:16
Parents
rPH8033a697461d: Catch errors that may occur whilst receiving data from the Aphlict server.
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH3202f0f23ddf: Post data to the Aphlict server in JSON encoded form. (authored by Joshua Spence <josh@joshuaspence.com>).Jun 5 2014, 18:47