Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
4.11k stars 3.1k forks source link

Card - Company card created is not shown in preview #57477

Closed IuliiaHerets closed 1 week ago

IuliiaHerets commented 4 weeks ago

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: V9.1.6-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both If this was caught during regression testing, add the test name, ID and link from TestRail: https://github.com/Expensify/App/pull/57375 Issue reported by: Applause Internal Team Device used: Redminote 10s android 13 App Component: Other

Action Performed:

Pre-condition: This issue can be reproduced with a new non-validated or very old validated accounts

  1. Go to https://staging.new.expensify.com/home
  2. Go to workspace settings - enable company card
  3. Tap company card
  4. Create a card via American Express and complete the flow

Expected Result:

Company card created must be shown in preview

Actual Result:

Company card created is not shown in preview

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/b6a6ff35-c177-477d-af7a-05863c15182e

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @koko57
melvin-bot[bot] commented 4 weeks ago

Triggered auto assignment to @strepanier03 (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

DylanDylann commented 4 weeks ago

cc @koko57

koko57 commented 4 weeks ago

I can look into this tomorrow. @DylanDylann thanks for pinging!

koko57 commented 3 weeks ago

I will look at this while working on the https://github.com/Expensify/App/issues/57403 - maybe it could be done in one PR

koko57 commented 3 weeks ago

macOS/Safari is checked as the platform that the problem is occurring on, but I can't repro there

https://github.com/user-attachments/assets/ccdcac2c-c306-440d-9fd9-75f7cecc1deb

staging v9.1.7-0

I will check android

koko57 commented 3 weeks ago

I was able to reproduce it on Android app. Looking into this

koko57 commented 3 weeks ago

@mountiny @DylanDylann I'm getting this errors when trying to add a feed or even just after entering Company Cards page - IIRC we had a similar problem some time ago and Vicky handled it somehow. Do you happen to remember it? Today she's ooo, so I can't ask her, but I will try to search through the Slack conversations. It strange that it happens only on mobile.

Image Image

mountiny commented 3 weeks ago

@koko57 are you able to see if the key exists before creating the feed and its an array? I agree this looks odd that its only on a single platform

koko57 commented 3 weeks ago

I will check this

joekaufmanexpensify commented 3 weeks ago

Note: I can also reproduce this on android hybrid app with new validated accounts.

koko57 commented 3 weeks ago

I had some problems with building for android (again 🙄) but I wanted to know if it's only on android and tried on iOS - it's also reproducible on iOS

koko57 commented 3 weeks ago

Strange... after fighting almost half a day with android builds and being able to reproduce a few times on iOS, now when I finally was able to run android I cannot reproduce at all. Neither on android nor iOS

https://github.com/user-attachments/assets/1154356a-88e1-468a-8d68-d44cfc3234d2

koko57 commented 3 weeks ago

May I ask for a retest? I'll be ooo till EOW, if it's still reproducible and you'd like to be fixed asap, someone from my team can handle it - especially Artem, Vicky and Nikolay as they worked on the Company Cards project

narefyev91 commented 3 weeks ago

Will pick this up to check

narefyev91 commented 3 weeks ago

Tested on Android and Android Web. Was able to debug network - probably issue coming from here:

Image

@mountiny maybe you can check from BE side?

mountiny commented 2 weeks ago

91ba06fad84f7dfc-SJC

mountiny commented 2 weeks ago

404 Feed ID not found

feedID passed gl10251

Which means private_gl10251CompanyID was not set, which is set when the feed is setup by concierge

mountiny commented 2 weeks ago

I am not sure if this would cause the issue though PR is here https://github.com/Expensify/Auth/pull/14409 and we can retest after this

mountiny commented 2 weeks ago

PR was merged and will be deployed on Monday

mountiny commented 2 weeks ago

@koko57 @DylanDylann This was deployed, can you retest please?

DylanDylann commented 2 weeks ago

Can't reproduce. @joekaufmanexpensify Could you please check again?

https://github.com/user-attachments/assets/8fa4afaf-58d0-4814-8f6c-b2ec082d16c9

joekaufmanexpensify commented 2 weeks ago

I can still reproduce. Google Pixel 9 on hybrid app v9.1.11-3.

https://github.com/user-attachments/assets/6c6d2bc6-e1a0-4055-a2ab-a6a742bc17ad

melvin-bot[bot] commented 2 weeks ago

@strepanier03 @koko57 @narefyev91 @mountiny @DylanDylann this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

DylanDylann commented 2 weeks ago

@koko57 @narefyev91 Could you guys reproduce this bug anymore?

koko57 commented 2 weeks ago

@DylanDylann I'll check it

koko57 commented 2 weeks ago

I can recreate again - for me the request RequestFeedSetup returns correctly but I still get this error:

Image

bc the cardFeeds for ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER is an array. When we first enter the CompanyCrads page and the OpenPolicyCompanyCardsPage is called we get a correct value an {}, so it's the first time we get this error. Later when we try to add the feed we get the same.

I wondered if the default value was somehow defined somewhere, but I've noticed something strange when trying to check the values from the request on web - when resizing the screen and having the narrow display, OpenPolicyInitialPage request is sent (it is not sent on full-screen) and we get a wrong value for sharedNVP_private_domain_member_ - an array instead of an object

Image

when first set to array, after getting a correct value from OpenPolicyCompanyCardsPage or RequestFeedSetup we cannot replace the array

https://github.com/user-attachments/assets/08581584-9161-49ca-9a04-80543670f990

so we need to fix the value for sharedNVP_private_domain_member_ that is sent as a response for OpenPolicyInitialPage

cc @mountiny

koko57 commented 2 weeks ago

but I wonder why it wasn't reproducible for some time 🤔

mountiny commented 1 week ago

Raised a PR for this https://github.com/Expensify/Web-Expensify/pull/45868

melvin-bot[bot] commented 1 week ago

@koko57 Huh... This is 4 days overdue. Who can take care of this?

koko57 commented 1 week ago

@mountiny is the PR https://github.com/Expensify/Web-Expensify/pull/45868 already merged? If yes, I can retest it

mountiny commented 1 week ago

@koko57 yea please its in staging

koko57 commented 1 week ago

@mountiny The request gets a correct response with an {} instead of []

Image

https://github.com/user-attachments/assets/f9edd51b-db2e-46a1-9e70-c06364b539bb

https://github.com/user-attachments/assets/ccd1fea8-f851-49e9-82eb-7f8697ee64c2

but I've found something weird (look at the first vid) - for a new workspace company cards are already checked as enabled (?!). I had it on web, on mobile it haven't occurred. I will check it and if it's reproducible reliably, if so I think we need to open an issue for it (if it hasn't been opened already).

But this issue - FIXED 🎉 I think we can close it

koko57 commented 1 week ago

ok it is reproducible, now I could even reproduce it on mobile. And I was able to repro it on the web full screen I don't think it's because of this empty object being sent for OpenPolicyInitialPage response

narefyev91 commented 1 week ago

@koko57 Company card toggle is set to be enabled by default for any new workspaces. It was the new requirements

koko57 commented 1 week ago

aaah ok, thanks @narefyev91!

so case closed 😅

mountiny commented 1 week ago

Haha yeah feature not a bug

Thank you for looking!