Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

per org messaging service #175

Merged

Conversation

ben-pr-p
Copy link
Contributor

@ben-pr-p ben-pr-p commented Jun 6, 2019

No description provided.

@ben-pr-p ben-pr-p marked this pull request as ready for review June 6, 2019 19:25
@ben-pr-p ben-pr-p requested a review from bchrobot June 6, 2019 19:25
Copy link
Member

@bchrobot bchrobot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea of message services are Twilio-specific. Given that we are still considering moving entirely from Twilio to Nexmo, I think we want to save ourselves the hypothetical work down the line and figure out how to write this in a Twilio-specific way now.

dev-tools/migrate-to-db-managed-messaging-services.js Outdated Show resolved Hide resolved
dev-tools/migrate-to-db-managed-messaging-services.js Outdated Show resolved Hide resolved
dev-tools/migrate-to-db-managed-messaging-services.js Outdated Show resolved Hide resolved
dev-tools/migrate-to-db-managed-messaging-services.js Outdated Show resolved Hide resolved
dev-tools/migrate-to-db-managed-messaging-services.js Outdated Show resolved Hide resolved
src/server/api/lib/twilio.js Outdated Show resolved Hide resolved
src/server/api/lib/twilio.js Show resolved Hide resolved
@@ -232,6 +232,11 @@ export async function uploadContacts(job) {

try {
await trx("campaign_contact").insert(chunk);
await ensureAllNumbersHaveMessagingServiceSIDs(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this an optional message service function:

import serviceMap from "../server/api/lib/services";

...

            try {
                await trx("campaign_contact").insert(chunk);
                const service = serviceMap[process.env.DEFAULT_SERVICE];
                if (service.ensureAllNumbersHaveMessagingServiceSIDs)
                    await service.ensureAllNumbersHaveMessagingServiceSIDs(

}))
);

cellsUsedForMakingUpGap = cellsUsedForMakingUpGap.concat(gap);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it's adding a number to a list of cell phone numbers (string[])?

src/workers/jobs.js Outdated Show resolved Hide resolved
@bchrobot bchrobot merged commit 56a0324 into politics-rewired/deploy Jun 7, 2019
@bchrobot bchrobot deleted the politics-rewired/per-org-messaging-service branch June 7, 2019 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants