Skip to content

Conversation

@arturgesiarz
Copy link
Member

Why

Added documentation to the expo-blob package for better clarity and accessibility.
Refactored type definitions by moving them to BlobModule.types.ts file for improved code organization and maintainability.

How

Test Plan

Checklist

  • [] I added a changelog.md entry and rebuilt the package sources according to this short guide
  • [] This diff will work correctly for npx expo prebuild & EAS Build (eg: updated a module plugin).
  • [] Conforms with the Documentation Writing Style Guide

@arturgesiarz arturgesiarz requested a review from aleqsio July 24, 2025 09:17
Copy link
Collaborator

@HubertBer HubertBer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I'm not sure if we should write in docs that stream is efficient, when it actually calls bytes() under the hood

@arturgesiarz
Copy link
Member Author

Looks good, but I'm not sure if we should write in docs that stream is efficient, when it actually calls bytes() under the hood

I think the bytes() docs should be here to make everything compatible with the API

Copy link
Collaborator

@HubertBer HubertBer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! LGTM

@arturgesiarz arturgesiarz merged commit 6b3ac67 into main Jul 25, 2025
@arturgesiarz arturgesiarz deleted the structure-refactoring branch July 25, 2025 11:23
HubertBer pushed a commit that referenced this pull request Dec 4, 2025
# Why

Ran into an issue with background tasks (triggered by a background
notification):

<details>
<summary>Details</summary>

```
(lldb) bt
* thread #19, queue = 'expo.application.remoteNotification', stop reason = EXC_BREAKPOINT (code=1, subcode=0x1038578e4)
    frame #0: 0x00000001038578e4 libdispatch.dylib`_dispatch_assert_queue_fail + 120
    frame #1: 0x000000010388e01c libdispatch.dylib`dispatch_assert_queue$V2.cold.1 + 116
    frame #2: 0x0000000103857868 libdispatch.dylib`dispatch_assert_queue + 108
    frame #3: 0x000000018996003c libswift_Concurrency.dylib`_swift_task_checkIsolatedSwift + 48
    frame #4: 0x00000001899bf724 libswift_Concurrency.dylib`swift_task_isCurrentExecutorWithFlagsImpl(swift::SerialExecutorRef, swift::swift_task_is_current_executor_flag) + 356
    frame #5: 0x00000001050e6678 notificationtester.debug.dylib`closure #1 in closure #2 in static ExpoAppDelegateSubscriberManager.application(result=.noData, failedCount=0, newDataCount=0, 
subscribersLeft=2, completionHandler=0x0000000104f6dea8 notificationtester.debug.dylib`partial apply forwarder for reabstraction thunk helper from @escaping @callee_unowned @convention(block) (@unowned 
__C.UIBackgroundFetchResult) -> () to @escaping @callee_guaranteed (@unowned __C.UIBackgroundFetchResult) -> () at <compiler-generated>) at ExpoAppDelegateSubscriberManager.swift:0
    frame #8: 0x000000010386e2e0 libdispatch.dylib`_dispatch_client_callout + 16
    frame #9: 0x00000001038653cc libdispatch.dylib`_dispatch_lane_barrier_sync_invoke_and_complete + 172
  * frame #10: 0x00000001050e650c notificationtester.debug.dylib`closure #2 in static ExpoAppDelegateSubscriberManager.application(result=.noData, dispatchQueue=0x000000012c455d80, failedCount=0, 
newDataCount=0, subscribersLeft=2, completionHandler=0x0000000104f6dea8 notificationtester.debug.dylib`partial apply forwarder for reabstraction thunk helper from @escaping @callee_unowned @convention(block)
 (@unowned __C.UIBackgroundFetchResult) -> () to @escaping @callee_guaranteed (@unowned __C.UIBackgroundFetchResult) -> () at <compiler-generated>) at ExpoAppDelegateSubscriberManager.swift:225:21
    frame #12: 0x0000000104f6bad8 notificationtester.debug.dylib`__94-[EXLegacyAppDelegateWrapper 
application:didReceiveRemoteNotification:fetchCompletionHandler:]_block_invoke(.block_descriptor=0x0000000120206340, result=UIBackgroundFetchResultNoData) at EXLegacyAppDelegateWrapper.m:212:9
    frame #13: 0x0000000104f65064 notificationtester.debug.dylib`__63-[EXTaskService runTasksWithReason:userInfo:completionHandler:]_block_invoke(.block_descriptor=0x000000012bbebc90, results=@"1 element") 
at EXTaskService.m:351:7
    frame #14: 0x0000000104f666f8 notificationtester.debug.dylib`__67-[EXTaskService _runTasksSupportingLaunchReason:userInfo:callback:]_block_invoke(.block_descriptor=0x0000000120204f80, results=@"1 
element") at EXTaskService.m:517:7
    frame #15: 0x0000000104f60cdc notificationtester.debug.dylib`-[EXTaskExecutionRequest _maybeExecuteCallback](self=0x000000012c519b60, _cmd="_maybeExecuteCallback") at EXTaskExecutionRequest.m:59:5
    frame #16: 0x0000000104f60c74 notificationtester.debug.dylib`-[EXTaskExecutionRequest maybeEvaluate](self=0x000000012c519b60, _cmd="maybeEvaluate") at EXTaskExecutionRequest.m:46:5
    frame #17: 0x0000000104f60b98 notificationtester.debug.dylib`-[EXTaskExecutionRequest task:didFinishWithResult:](self=0x000000012c519b60, _cmd="task:didFinishWithResult:", task=0x0000000120370840, 
result=(long)1) at EXTaskExecutionRequest.m:35:3
    frame #18: 0x0000000104f63e64 notificationtester.debug.dylib`-[EXTaskService notifyTaskWithName:forAppId:didFinishWithResponse:](self=0x00000001200014c0, 
_cmd="notifyTaskWithName:forAppId:didFinishWithResponse:", taskName=@"BACKGROUND_NOTIFICATION_TASK", appId=@"mainApplication", response=1 key/value pair) at EXTaskService.m:217:7
    frame #19: 0x0000000104f617c4 notificationtester.debug.dylib`-[EXTaskManager notifyTaskFinished:withResponse:resolve:reject:](self=0x0000000120371600, 
_cmd="notifyTaskFinished:withResponse:resolve:reject:", taskName=@"BACKGROUND_NOTIFICATION_TASK", response=1 key/value pair, resolve=0x000000010ad20e7c, reject=0x000000010ad213bc) at EXTaskManager.m:104:3
    frame #20: 0x000000018b4ee6c4 CoreFoundation`__invoking___ + 148
    frame #21: 0x000000018b4ee550 CoreFoundation`-[NSInvocation invoke] + 424
    frame #22: 0x0000000105015b5c notificationtester.debug.dylib`-[EXExportedModule callExportedMethod:withArguments:resolver:rejecter:](self=0x0000000120371600, 
_cmd="callExportedMethod:withArguments:resolver:rejecter:", methodName=@"notifyTaskFinishedAsync", arguments=@"2 elements", resolve=0x000000010ad20e7c, reject=0x000000010ad213bc) at EXExportedModule.m:168:3
    frame #23: 0x000000010501fa10 notificationtester.debug.dylib`__79-[EXNativeModulesProxy callMethod:methodNameOrKey:arguments:resolver:rejecter:]_block_invoke(.block_descriptor=0x0000000122ea9270) at 
EXNativeModulesProxy.mm:243:7
    frame #24: 0x000000010385463c libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #25: 0x000000010386e2e0 libdispatch.dylib`_dispatch_client_callout + 16
    frame expo#26: 0x000000010385cb4c libdispatch.dylib`_dispatch_lane_serial_drain + 796
    frame expo#27: 0x000000010385d7d4 libdispatch.dylib`_dispatch_lane_invoke + 432
    frame expo#28: 0x0000000103869b20 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 344
    frame expo#29: 0x00000001038691c4 libdispatch.dylib`_dispatch_workloop_worker_thread + 752
    frame expo#30: 0x00000001e7d803b8 libsystem_pthread.dylib`_pthread_wqthread + 292
```

</details>

# How

- dispatch the completion handlers on main queue

# Test Plan

- tested locally with notification-tester app

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
-->

- [x] I added a `changelog.md` entry and rebuilt the package sources
according to [this short
guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants