Skip to content

[$500] Chat - Loading animation not shown when open 1:1 Conversation with uncached attachments #32699

Closed

Description

@izarutskaya

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


Found when executing PR: #13036

Version Number: v1.4.9-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause-Internal team
Slack conversation: @

Action Performed:

Precondition: user should be signed in

  1. Open the app
  2. Send several type attachments from the other account on main device
  3. Disable internet connection
  4. Open the 1:1 Conversation (attachments should be uncached)

Expected Result:

The attachment previews should be empty with infinite loading indicator because the attachment were uncached and user is offline.

Actual Result:

The attachments should appear in an infinite loading state, indicating they cannot be fetched without an internet connection

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

RPReplay_Final1701973445.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d5ec534790c61159
  • Upwork Job ID: 1732883412213059584
  • Last Price Increase: 2024-01-04
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    External
    Daily
    Bug
    on Dec 7, 2023
  2. melvin-bot commented on Dec 7, 2023

    @melvin-bot

    Triggered auto assignment to @JmillsExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. changed the title [-]Chat - Loading animation not shown when open 1:1 Conversation with uncached attachments[/-] [+][$500] Chat - Loading animation not shown when open 1:1 Conversation with uncached attachments[/+] on Dec 7, 2023
  4. melvin-bot commented on Dec 7, 2023

    @melvin-bot
  5. melvin-bot commented on Dec 7, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  6. added
    Help Wanted
    on Dec 7, 2023
  7. melvin-bot commented on Dec 7, 2023

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (External)

  8. ikevin127 commented on Dec 7, 2023

    @ikevin127
  9. tienifr commented on Dec 8, 2023

    @tienifr
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue

    Chat - Loading animation not shown when open 1:1 Conversation with uncached attachments

    What is the root cause of that problem?

    We're using isLoading and isImageCached to show the loading

    {isLoading && !isImageCached && <FullscreenLoadingIndicator style={[styles.opacity1, styles.bgTransparent]} />}

    but we update these states in onLoadEnd callback

    This callback will be invoked when load either succeeds or fails

    so when the images load fails, isLoading is false -> there's no loading indicator

    What changes do you think we should make in order to solve the problem?

    Solution 1: Show the loading for all error images

    We should move this logic to imageLoadedSuccessfully

    then trigger onLoad when network.isOffline is false

        useEffect(() => {
            // If an onLoad callback was specified then manually call it and pass
            // the natural image dimensions to match the native API
            if (onLoad == null || isOffline) {
                return;
            }
            RNImage.getSize(source.uri, (width, height) => {
                onLoad({nativeEvent: {width, height}});
            });
        }, [onLoad, source, isOffline]);
    

    And update other components that faces this issue as well

    Solution 2: Show the loading for the error images while offline

    Do the same as the solution 1, but in onError we should add the logic to handle error image

      const onError = () => {
        Log.hmmm('Unable to fetch image to calculate size', {url});
         if(isOffline){
             return;
         }
        setIsLoading(false);
        setIsImageCached(true);
      };
    

    Result

    Screen.Recording.2023-12-08.at.11.46.02.mov
  10. ikevin127 commented on Dec 8, 2023

    @ikevin127
    Contributor

    Cannot reproduce the issue following the given steps.

  11. 104 remaining items

  12. added
    Weekly
    Needs Reproduction
    Awaiting Payment
    and removed
    Daily
    on Aug 14, 2024
  13. MelvinBot commented on Aug 14, 2024

    @MelvinBot
    Contributor

    This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

  14. mallenexpensify commented on Aug 14, 2024

    @mallenexpensify
    Contributor

    Assigned myself as the owner and bumping to weekly pending when payment due on the below

  15. getusha commented on Aug 19, 2024

    @getusha
    Contributor

    @mallenexpensify could you end the UW contract? ty!

  16. mallenexpensify commented on Aug 19, 2024

    @mallenexpensify
    Contributor

    Done, contract ended @getusha

  17. added
    Daily
    and removed
    Weekly
    on Aug 21, 2024
  18. getusha commented on Aug 24, 2024

    @getusha
    Contributor

    @mallenexpensify the contract ended but strangely i didn't receive the payment

    Screenshot 2024-08-24 at 11 37 03 in the morning

  19. mallenexpensify commented on Aug 26, 2024

    @mallenexpensify
    Contributor

    All set @getusha , sorry about that
    image

    Updated the payment post above too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineeringExternalNeeds ReproductionNot a priority

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions