You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-03-17] Web - BaseVideoPlayer - Loader does not appear consistently during slow network #82779
Version Number: 9.3.21-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#82480 Email or phone of affected tester (no customers):applausetester+th12@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 11 App Component: Other
Action Performed:
Open the New Expensify App on Web.
Go to the workspace chat.
Click on “+” → “Add attachment”.
Select a short video (<24MB).
Before sending or playing the video, activate “Simulate poor internet connection” (network throttling / slow network).
Send or open the video.
Observe the loader behavior (ActivityIndicator).
Expected Result:
The loader (ActivityIndicator) should remain visible consistently while the video is loading or buffering under slow network conditions.
Once the video loads and starts playing, the loader disappears.
Actual Result:
The loader appears briefly at the start of the video load.
When the connection fluctuates, the app shows “No Connection” and does not keep the loader visible.
The video eventually loads and plays normally only after exiting and re-entering, without the loader being displayed during intermittent loading.
Please re-state the problem that we are trying to solve in this issue.
On web, when a video is loading or buffering under slow/intermittent network conditions, the loading spinner (ActivityIndicator) in BaseVideoPlayer disappears prematurely. Instead of showing a consistent loader while the video buffers, the app either shows "No Connection" briefly or shows nothing at all, and the video only plays correctly after exiting and re-entering the view.
What is the root cause of that problem?
There are two compounding issues in BaseVideoPlayer.tsx that cause the loader to disappear under slow/intermittent networks:
1. shouldShowLoadingIndicator excludes the offline case and mid-playback buffering
The !isOffline condition means the spinner disappears the instant isOffline becomes true. On slow networks, NetInfo detects offline status when the reachability ping to api/Ping times out (10s threshold), even though the video CDN may still be serving data. This causes the spinner to vanish while the video is still buffering.
The !isPlaying condition means once a video starts playing (isPlaying=true) and stalls due to a buffer underrun, the spinner will NOT reappear. This is because in the HTML5 video spec, the browser does NOT fire onpause during a buffering stall — playing stays true while the expo-video web player sets status back to 'loading' via onwaiting (VideoPlayer.web.js:367-371). So isLoading=true but isPlaying=true and currentTime > 0, making the condition evaluate to false.
2. The replaceAsync('') effect aggressively kills the video source
When isOffline flips to true while the video is loading, the source is replaced with an empty string, aborting any in-progress load. The recovery path at lines 99-106 only fires replaceAsync(sourceURL) if currentTime <= 0 && hasError, which may not be satisfied if the empty source replacement doesn't produce an error status from expo-video.
Additionally, shouldShowOfflineIndicator at line 133-135 requires currentTime + bufferedPosition <= 0, so if any data was buffered before the offline flag triggered, neither the offline indicator nor the loading spinner shows — creating a visual dead zone where the user has no feedback at all.
What changes do you think we should make in order to solve the problem?
The fix should be applied in src/components/VideoPlayer/BaseVideoPlayer.tsx:
Remove the !isOffline condition from shouldShowLoadingIndicator (or add a secondary condition that shows the spinner when isLoading && isOffline). The loading spinner should remain visible when the video is in a loading status regardless of the offline flag, since the video may still be loading from CDN even when the Expensify API ping fails.
Remove or relax the !isPlaying condition for mid-playback buffering stalls. When status === 'loading' (which expo-video sets via onwaiting during buffer stalls), the spinner should show even if the video was previously playing. Consider changing the condition to just isLoading && !hasError — or alternatively, use the playingChange event from expo-video to track isPlaying reactively (currently it's read as a non-reactive snapshot at line 85).
Remove or guard the replaceAsync('') effect so it does not destroy the video source during intermittent network conditions. This effect should only fire if the device is confirmed fully offline for a sustained period, not on momentary NetInfo flickers. One approach is to add a debounce or only abort the load when the video has been offline+loading for longer than a threshold (e.g., matching the 10s NetInfo timeout).
What alternative solutions did you explore? (Optional)
An alternative would be to introduce a separate "video-specific" offline detection mechanism that checks CDN reachability rather than relying on the global isOffline flag from useNetwork() (which pings the Expensify API). This would more accurately reflect whether the video can actually load. However, this would be a larger architectural change and the simpler approach above (adjusting the indicator conditions and removing the aggressive source replacement) addresses the core symptoms directly.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
Now We want to show the loading indicator when video is loading && paused or (currentTime <= 0) && it should be online and without error (all these conditions are met)
We show the you appears to offline via AttachmentOfflineIndicator here
What changes do you think we should make in order to solve the problem?
We need to add one more condition in shouldShowOfflineIndicator - > !isLoading
We want to show shouldShowOfflineIndicator only when isOffline is true && currentTime + bufferedPosition <= 0 && !isLoading
Remove the !isOffline check from shouldShowLoadingIndicator
Updated code:
constshouldShowLoadingIndicator=useMemo(()=>{// We want to show LoadingIndicator when video's loading and paused, except when it's loading// for the first time, then playing/loading may vary. And without errors.returnisLoading&&(!isPlaying||currentTime<=0)&&!hasError;},[currentTime,hasError,isLoading,isPlaying]);constshouldShowOfflineIndicator=useMemo(()=>{returnisOffline&¤tTime+bufferedPosition<=0&&!isLoading;},[bufferedPosition,currentTime,isOffline,isLoading]);
This will ensure the loader appears consistently
What alternative solutions did you explore? (Optional)
Result:
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Please re-state the problem that we are trying to solve in this issue.
The loading spinner in the video player disappears inconsistently during slow or unstable network conditions. When the connection fluctuates, the "No Connection" indicator appears instead of the loading spinner, even though the video is still buffering.
What is the root cause of that problem?
The shouldShowLoadingIndicator logic in BaseVideoPlayer.tsx includes !isOffline as a condition. This causes the loading indicator to vanish whenever the network status reports offline, regardless of whether the video is actively loading. During poor connections, the video can still be buffering while the app reports offline, making this assumption incorrect.
constshouldShowLoadingIndicator=useMemo(()=>{// Show loading indicator when video is loading, even on poor connection.returnisLoading&&(!isPlaying||currentTime<=0)&&!hasError;},[currentTime,hasError,isLoading,isPlaying]);constshouldShowOfflineIndicator=useMemo(()=>{// Show offline indicator only when not actively loading.returnisOffline&¤tTime+bufferedPosition<=0&&!isLoading;},[bufferedPosition,currentTime,isOffline,isLoading]);
This ensures the loading indicator takes priority when the video is buffering, while the offline indicator only appears when no content is buffered and the video is not loading.
What alternative solutions did you explore? (Optional)
Considered debouncing the network state to handle rapid fluctuations, but rejected because:
Adds complexity
The proposed fix already prevents simultaneous indicator display
No flickering was reported in the issue
Files Modified:
src/components/VideoPlayer/BaseVideoPlayer.tsx - Updated loading and offline indicator conditions
⚠️@mobile84developer-ctrl Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: Not Required. The existing checklist is good enough to capture such issues.
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Open the app on web (Chrome)
Navigate to a workspace chat
Send a short video (<24MB)
Open Chrome DevTools → Network tab → set throttling to "Slow 3G"
Open/play the video
Verify the loading spinner remains visible consistently while the video is buffering
Verify no "No Connection" indicator flashes during the slow loading
Set DevTools to "Offline" mode
Wait at least 7 seconds
Verify the offline indicator appears after the threshold
Re-enable the network
Verify the loading spinner reappears (or video resumes playing)
Issue is ready for payment but no BZ is assigned. @mallenexpensify you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!
Activity
melvin-bot commentedon Feb 18, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rojiphil (
External)melvin-bot commentedon Feb 18, 2026
Triggered auto assignment to @joekaufmanexpensify (
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.melvin-bot commentedon Feb 18, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
MelvinBot commentedon Feb 18, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On web, when a video is loading or buffering under slow/intermittent network conditions, the loading spinner (ActivityIndicator) in
BaseVideoPlayerdisappears prematurely. Instead of showing a consistent loader while the video buffers, the app either shows "No Connection" briefly or shows nothing at all, and the video only plays correctly after exiting and re-entering the view.What is the root cause of that problem?
There are two compounding issues in
BaseVideoPlayer.tsxthat cause the loader to disappear under slow/intermittent networks:1.
shouldShowLoadingIndicatorexcludes the offline case and mid-playback bufferingAt
BaseVideoPlayer.tsx:128-132:!isOfflinecondition means the spinner disappears the instantisOfflinebecomestrue. On slow networks,NetInfodetects offline status when the reachability ping toapi/Pingtimes out (10s threshold), even though the video CDN may still be serving data. This causes the spinner to vanish while the video is still buffering.!isPlayingcondition means once a video starts playing (isPlaying=true) and stalls due to a buffer underrun, the spinner will NOT reappear. This is because in the HTML5 video spec, the browser does NOT fireonpauseduring a buffering stall —playingstaystruewhile the expo-video web player sets status back to'loading'viaonwaiting(VideoPlayer.web.js:367-371). SoisLoading=truebutisPlaying=trueandcurrentTime > 0, making the condition evaluate tofalse.2. The
replaceAsync('')effect aggressively kills the video sourceAt
BaseVideoPlayer.tsx:108-113:When
isOfflineflips totruewhile the video is loading, the source is replaced with an empty string, aborting any in-progress load. The recovery path at lines 99-106 only firesreplaceAsync(sourceURL)ifcurrentTime <= 0 && hasError, which may not be satisfied if the empty source replacement doesn't produce an error status from expo-video.Additionally,
shouldShowOfflineIndicatorat line 133-135 requirescurrentTime + bufferedPosition <= 0, so if any data was buffered before the offline flag triggered, neither the offline indicator nor the loading spinner shows — creating a visual dead zone where the user has no feedback at all.What changes do you think we should make in order to solve the problem?
The fix should be applied in
src/components/VideoPlayer/BaseVideoPlayer.tsx:Remove the
!isOfflinecondition fromshouldShowLoadingIndicator(or add a secondary condition that shows the spinner whenisLoading && isOffline). The loading spinner should remain visible when the video is in aloadingstatus regardless of the offline flag, since the video may still be loading from CDN even when the Expensify API ping fails.Remove or relax the
!isPlayingcondition for mid-playback buffering stalls. Whenstatus === 'loading'(which expo-video sets viaonwaitingduring buffer stalls), the spinner should show even if the video was previously playing. Consider changing the condition to justisLoading && !hasError— or alternatively, use theplayingChangeevent from expo-video to trackisPlayingreactively (currently it's read as a non-reactive snapshot at line 85).Remove or guard the
replaceAsync('')effect so it does not destroy the video source during intermittent network conditions. This effect should only fire if the device is confirmed fully offline for a sustained period, not on momentary NetInfo flickers. One approach is to add a debounce or only abort the load when the video has been offline+loading for longer than a threshold (e.g., matching the 10s NetInfo timeout).What alternative solutions did you explore? (Optional)
An alternative would be to introduce a separate "video-specific" offline detection mechanism that checks CDN reachability rather than relying on the global
isOfflineflag fromuseNetwork()(which pings the Expensify API). This would more accurately reflect whether the video can actually load. However, this would be a larger architectural change and the simpler approach above (adjusting the indicator conditions and removing the aggressive source replacement) addresses the core symptoms directly.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.PiyushChandra17 commentedon Feb 18, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-02-20 08:05:01 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Web - BaseVideoPlayer - Loader does not appear consistently during slow network
What is the root cause of that problem?
LoadingIndicatorifshouldShowLoadingIndicatoris truthy,App/src/components/VideoPlayer/BaseVideoPlayer.tsx
Lines 128 to 132 in c835e8d
Now We want to show the loading indicator when video is
loading&&paused or (currentTime <= 0)&& it should beonlineand withouterror(all these conditions are met)We show the
you appears to offlineviaAttachmentOfflineIndicatorhereApp/src/components/AttachmentOfflineIndicator.tsx
Lines 46 to 51 in c835e8d
App/src/components/VideoPlayer/BaseVideoPlayer.tsx
Lines 133 to 135 in c835e8d
App/src/components/VideoPlayer/BaseVideoPlayer.tsx
Line 517 in c835e8d
What changes do you think we should make in order to solve the problem?
We need to add one more condition in
shouldShowOfflineIndicator- >!isLoadingWe want to show
shouldShowOfflineIndicatoronly whenisOfflineistrue&¤tTime + bufferedPosition <= 0&&!isLoadingRemove the
!isOfflinecheck fromshouldShowLoadingIndicatorUpdated code:
This will ensure the loader appears consistently
What alternative solutions did you explore? (Optional)
Result:
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
HiepPP commentedon Feb 18, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The loading spinner in the video player disappears inconsistently during slow or unstable network conditions. When the connection fluctuates, the "No Connection" indicator appears instead of the loading spinner, even though the video is still buffering.
What is the root cause of that problem?
The
shouldShowLoadingIndicatorlogic inBaseVideoPlayer.tsxincludes!isOfflineas a condition. This causes the loading indicator to vanish whenever the network status reports offline, regardless of whether the video is actively loading. During poor connections, the video can still be buffering while the app reports offline, making this assumption incorrect.App/src/components/VideoPlayer/BaseVideoPlayer.tsx
Lines 128 to 132 in 637a82c
What changes do you think we should make in order to solve the problem?
Modify the indicator display logic in
src/components/VideoPlayer/BaseVideoPlayer.tsx:Remove
!isOfflinefromshouldShowLoadingIndicatorso the loading indicator shows whenever the video is actively loading, regardless of network status.Add
!isLoadingtoshouldShowOfflineIndicatorto prevent both indicators from displaying simultaneously.App/src/components/VideoPlayer/BaseVideoPlayer.tsx
Lines 128 to 135 in 637a82c
This ensures the loading indicator takes priority when the video is buffering, while the offline indicator only appears when no content is buffered and the video is not loading.
What alternative solutions did you explore? (Optional)
Considered debouncing the network state to handle rapid fluctuations, but rejected because:
Files Modified:
src/components/VideoPlayer/BaseVideoPlayer.tsx- Updated loading and offline indicator conditionsTesting Performed:
mobile84developer-ctrl commentedon Feb 18, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
github-actions commentedon Feb 18, 2026
34 remaining items
rojiphil commentedon Mar 16, 2026
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: Not Required. The existing checklist is good enough to capture such issues.
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
joekaufmanexpensify commentedon Mar 16, 2026
Thanks! Will handle next steps so we can pay tomorrow.
melvin-bot commentedon Mar 17, 2026
Issue is ready for payment but no BZ is assigned. @mallenexpensify you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!
melvin-bot commentedon Mar 17, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
joekaufmanexpensify commentedon Mar 17, 2026
Regression issue: https://github.com/Expensify/Expensify/issues/613034
joekaufmanexpensify commentedon Mar 17, 2026
Payment Summary
joekaufmanexpensify commentedon Mar 17, 2026
@rojiphil please request payment in NewDot at your earliest convenience. Closing as this is otherwise all set 👍
quinthar commentedon Apr 13, 2026
Approved $250 to @rojiphil