ConnectyCube / connectycube-reactnative-samples

Chat and Video Chat code samples for React Native, ConnectyCube
https://connectycube.com
Apache License 2.0
124 stars 111 forks source link

CB SERVERS DOWN #231

Closed CMLCNL closed 3 years ago

CMLCNL commented 3 years ago

Currently, our application in appstore and playstore does not open. Such an error arose after you made it to the servers. Close to 10 thousand can not enter now. So urgent.

Object {
  "code": 422,
  "detail": Object {
    "base": Array [
      "The default Firebase app already exists. This means you called initializeApp() more than once without providing an app name as the second argument. In most cases you only need to call initializeApp() once. But if you do want to initialize multiple apps, pass a second argument to initializeApp() to give each app a unique name.",
    ],
  },
  "message": Object {
    "errors": Object {
      "base": Array [
        "The default Firebase app already exists. This means you called initializeApp() more than once without providing an app name as the second argument. In most cases you only need to call initializeApp() once. But if you do want to initialize multiple apps, pass a second argument to initializeApp() to give each app a unique name.",
      ],
    },
  },
  "status": "error",
}
DaveLomber commented 3 years ago

Thank you for reporting the issue

We are investigating the root cause

Will update here with more info

CMLCNL commented 3 years ago

I assure you it needs to be resolved very urgently. We log in with Firebase phone verification. Our users are waiting for you. It is very urgent. @DaveLomber

DaveLomber commented 3 years ago

The root cause is identified

The team is working on a patch

More updates to come soon

DaveLomber commented 3 years ago

@CMLCNL we have deployed the patch Could you please check at your side and let us know whether the issue is resolved

CMLCNL commented 3 years ago

Yes @DaveLomber everything is fine for now. Thank you very much.

CMLCNL commented 3 years ago

@DaveLomber Some of the problems we detected. The list of notifications sent in the -ConnectyCube admin panel does not work. -There is a problem with the voip notification. -We get complaints from our users. About not starting a conversation. During a voice or video call.

We are experiencing many problems with the new server update. Voip notification does not go away and we are having trouble starting voice and video calls.

DaveLomber commented 3 years ago

@CMLCNL could you please provide more info if possible re 2nd and 3rd cases

CMLCNL commented 3 years ago

We cannot send voip call notifications.

Some users said that the voip notification came, but they said they could not have a healthy conversation.

@DaveLomber

CMLCNL commented 3 years ago

ERROR SEND VOIP:

{"code": 422, "detail": {"notification_type": ["in validation failed on notification_type"]}, "message": {"errors": {"notification_type": [Array]}}, "status": "error"}

hey @DaveLomber please help us.

const payload = JSON.stringify({
                                    callerName,
                                    uuid: session.ID,
                                    handle,
                                    hasVideo: "0",
                                    ios_badge: 0,
                                    ios_sound: "teleconn.mp3",
                                    ios_voip: 1
                                });

                                console.log(payload, "payload");

                                const pushParameters = {
                                    notification_type: "apns_voip",
                                    user: { ids: [profile.ccId] }, // recipients.
                                    environment: __DEV__ ? 'development' : 'production',
                                    message: TeleconnChat.pushnotifications.base64Encode(payload)
                                };
CMLCNL commented 3 years ago

We used to write apns_voip in the notification type field before, but I think the change has been made now. Will it be enough to just write push?

DaveLomber commented 3 years ago

the 'push' is a valid one and should be used here

CMLCNL commented 3 years ago

There was no such thing before and now our application in playstore and appstore is exploding. Also, we cannot send voip notifications at the moment.

DaveLomber commented 3 years ago

so strange https://developers.connectycube.com/server/push_notifications?id=create-event

The valid values for 'event[notification_type]' are 'push' and 'email'

Not sure at what guides it was 'apns_voip'

Anyway

If it worked before - we will remove the validation

CMLCNL commented 3 years ago

You should definitely remove the validation. The right choice. thousands of users are waiting for you. We will be working with Connectcube at an enterprise level in the near future. We are on the verge of a big investment. Please remove validation.

DaveLomber commented 3 years ago

@CMLCNL removing it. Will deploy the change soon

CMLCNL commented 3 years ago

Our application is not working for 2 days. We had great difficulties. We may have a small number of users, but this is important for our investment. @DaveLomber thank you for your interest.

DaveLomber commented 3 years ago

Please check now and let us know

CMLCNL commented 3 years ago

@DaveLomber Voip notification never came other phone.

SEND VOIP [{"event": {"_id": "60957c60de4e09002069379b", "active": true, "created_at": "2021-05-07T17:44:00Z", "date": null, "end_date": null, "environment": "development", "event_type": "one_shot", "id": 9795, "kind": "API", "message": "eyJjYWxsZXJOYW1lIjoiQ2VtaWwgQ0FOTEkiLCJ1dWlkIjoiOGViM2ZkNWYtNzgzMC00YTU5LWIwZWEtNjg0ZjQ5NjRkYTUzIiwiaGFuZGxlIjoiMTIyOTIxMyIsImhhc1ZpZGVvIjoiMCIsImlvc19iYWRnZSI6MCwiaW9zX3NvdW5kIjoidGVsZWNvbm4ubXAzIiwiaW9zX3ZvaXAiOjF9", "name": null, "notification_channel": [Object], "period": null, "tag_query": null, "updated_at": "2021-05-07T17:44:00Z", "user_id": 1229213}}, {"event": {"_id": "60957c60de4e09002069379c", "active": true, "created_at": "2021-05-07T17:44:00Z", "date": null, "end_date": null, "environment": "production", "event_type": "one_shot", "id": 9796, "kind": "API", "message": "eyJjYWxsZXJOYW1lIjoiQ2VtaWwgQ0FOTEkiLCJ1dWlkIjoiOGViM2ZkNWYtNzgzMC00YTU5LWIwZWEtNjg0ZjQ5NjRkYTUzIiwiaGFuZGxlIjoiMTIyOTIxMyIsImhhc1ZpZGVvIjoiMCIsImlvc19iYWRnZSI6MCwiaW9zX3NvdW5kIjoidGVsZWNvbm4ubXAzIiwiaW9zX3ZvaXAiOjF9", "name": null, "notification_channel": [Object], "period": null, "tag_query": null, "updated_at": "2021-05-07T17:44:00Z", "user_id": 1229213}}]

DaveLomber commented 3 years ago

@CMLCNL checking this now

CMLCNL commented 3 years ago

Is there any improvement?

DaveLomber commented 3 years ago

We identified the issue with subscription override where a user create both apns and apns_voip for same device id

The fix is on the way, should be deployed during next h

We continue checking the rest push functionality

More updates to come

DaveLomber commented 3 years ago

@CMLCNL the root cause of VOIP push notifications failure has been identified

A patch was deployed and tested, It all should work well now

Please double check at your side

CMLCNL commented 3 years ago

Despite all my attempts. Payload is always null.

const payload = JSON.stringify({
                                    callerName,
                                    uuid: session.ID,
                                    handle,
                                    hasVideo: "0",
                                    ios_badge: 0,
                                    ios_sound: "x.mp3",
                                    ios_voip: 1
                                });

                                console.log(payload, "payload");

                                const pushParameters = {
                                    notification_type: "apns_voip",
                                    user: { ids: [profile.ccId] }, // recipients.
                                    environment: __DEV__ ? 'development' : 'production',
                                    message: ConnectyCube.pushnotifications.base64Encode(payload)
                                };
- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(PKPushType)type withCompletionHandler:(void (^)(void))completion {

 NSObject* aps = payload.dictionaryPayload[@"aps"];

Payload is null. Voip notification is coming, but payload is not.

Look, I repeat. Everything was working before the server update. The application explodes because the payload is not coming.

Our CB version -> "connectycube-reactnative": "^1.8.1",

@DaveLomber

DaveLomber commented 3 years ago

The initial issue was related to voip pushes do not come at all. It's fixed now, the voip pushes go well now.

Then

Are you expecting all voip push params to come as a part of 'aps'?

Cause it comes now at top level, not inside 'aps'.

Is this your current issue?

CMLCNL commented 3 years ago

Yes, we expected it to be the same as before. Because now users cannot use the application.

CMLCNL commented 3 years ago

How does shipping at the highest level benefit us? If it is useful, I will update the application in AppStore.

DaveLomber commented 3 years ago

Not a benefit

Previously it was added to 'aps' by mistake cause 'aps' secrion is more for normal pushes - for some predefined params only

Anyway, will add it inside aps. Will update you once done

DaveLomber commented 3 years ago

@CMLCNL it should come inside aps now Could you please check and let us know

CMLCNL commented 3 years ago

hey @DaveLomber You changed the structure completely. It was not like that before. It was payload-> aps-> alert.

NSObject* aps = payload.dictionaryPayload[@"aps"];

 NSString* alert = [aps valueForKey:@"alert"];

 NSLog(@"%@", alert);

 NSData *webData = [alert dataUsingEncoding:NSUTF8StringEncoding];
 NSError *error;
 NSDictionary *jsonDic = [NSJSONSerialization JSONObjectWithData:webData options:NSJSONReadingMutableContainers error:&error];

 NSLog(@"%@", jsonDic);

 NSString *uuid = [jsonDic valueForKey:@"uuid"];
 NSString *callerName = [jsonDic valueForKey:@"callerName"];
 NSString *handle = [jsonDic valueForKey:@"handle"];

 NSLog(@"%@ %@ %@", handle,callerName,uuid);

Actually this is much better than what you do. I think you just put it all in payload.

For example: payload.dictionaryPayload [@ "callerName"];

Let it come at the highest level. Let me assign the AppStroe update. Because I used to have to serialize the data.

CMLCNL commented 3 years ago

Get data at the highest level. I will update the AppStore.

- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(PKPushType)type withCompletionHandler:(void (^)(void))completion {

  NSString *uuid = payload.dictionaryPayload[@"uuid"];
  NSString *callerName = payload.dictionaryPayload[@"callerName"];
  NSString *handle = payload.dictionaryPayload[@"handle"];

 NSLog(@"%@ %@ %@", handle,callerName,uuid);
DaveLomber commented 3 years ago

@CMLCNL please check now

we send it now both at highest level and inside aps.alert as string

CMLCNL commented 3 years ago

Congratulations. Thank you for your interest. Now its working voip notification.

DaveLomber commented 3 years ago

Sweet much appreciated for your patience