CondeNast / launch-vehicle-fbm

An event driven SDK for Facebook Messenger
https://launch-vehicle-fbm.readthedocs.io/en/latest/
Apache License 2.0
13 stars 3 forks source link

Add plumbing for page specific operations #49

Closed crccheck closed 7 years ago

crccheck commented 7 years ago

Why are we doing this?

Currently, the SDK assumes that the bot will only be deployed on one page. But Facebook lets you associate a bot with multiple pages. This PR adds the plumbing necessary so calls that depend on the page now take pageId as an argument. The SDK constructor has a new option for page ids because it needs to know how to turn a page id into an access token. For now, the new pageId is optional as long as the user still has the existing page id and page access token config set.

Closes #30

Did you document your work?

How can someone test these changes?

Steps to manually verify the change:

  1. npm i
  2. npm t

Link to an existing bot and make sure your existing bot works:

  1. npm link
  2. go to your bot
  3. npm link launch-vehicle-fbm
  4. run and test your bot

What possible risks or adverse effects are there?

What are the follow-up tasks?

Are there any known issues?

none

Did the test coverage decrease?

increases. Some previously uncovered code is now covered. Most of the new LOC is tests, then backwards compatibility that can be deleted later.

crccheck commented 7 years ago

This is ready for review even though it's WIP. It just needs docs.

crccheck commented 7 years ago

ok, I just did a manual QA using npm link, found an issue with backwards compatibility, and pushed a fix. ready for review for realz this time.