Page MenuHomePhabricator

[keyserver] Replace deprecated sendToDevice firebase-admin method
ClosedPublic

Authored by ashoat on Sep 17 2024, 12:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 7, 11:10 PM
Unknown Object (File)
Thu, Oct 3, 7:24 PM
Unknown Object (File)
Thu, Oct 3, 6:41 PM
Unknown Object (File)
Thu, Oct 3, 5:21 PM
Unknown Object (File)
Sat, Sep 28, 3:44 AM
Unknown Object (File)
Sat, Sep 28, 2:13 AM
Unknown Object (File)
Fri, Sep 27, 3:32 PM
Unknown Object (File)
Wed, Sep 25, 11:34 PM
Subscribers

Details

Summary

This method is deprecated and is now completely failing all requests. This diff resolves ENG-235.

Test Plan

I set up a test environment on my personal server. It's running the latest keyserver release (115). In this environment, I created a test script to generate some notifs by sending messages from commbot to a test account. I confirmed that the test account received a notif on an Android device it's logged into.

I also did some testing to make sure the error handling logic worked correctly. In my test environment, I set the device token to fake and checked what the error response looked like, and made sure that error.errorInfo.code contained the error code. For my fake device token, the error code ended up being messaging/invalid-argument, but I'm pretty sure that the error code would appear in the same place for the types of errors we care about (fcmTokenInvalidationErrors).

Diff Detail

Repository
rCOMM Comm
Branch
ashoat/android
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ashoat published this revision for review.Sep 17 2024, 1:02 PM

Will wait on CI before landing

keyserver/flow-typed/npm/firebase-admin_vx.x.x.js
25

Normally I don't love having Object in types... it's basically any. However, in this case I want to resolve this urgent issue ASAP, and the type here is rather complicated. Even if we only included the subset of types we actually use, it would take a while to get all of it.

I created a follow-up task to track this work: ENG-9327

Guessing there’s some tunnelbroker follow up work too?

This revision is now accepted and ready to land.Sep 17 2024, 1:06 PM

Guessing there’s some tunnelbroker follow up work too?

Don't think Tunnelbroker was using this deprecated API. cc @marcin, @kamil to confirm