Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions patches/react-native-pdf/details.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### [react-native-pdf+7.0.2+001+fix-onPressLink-android.patch](react-native-pdf+7.0.2+001+fix-onPressLink-android.patch)

- Reason:

```
This patch fixes the onPressLink callback not working on Android by upgrading the pdfiumandroid library from version 1.0.32 to 1.0.35.

Expand All @@ -19,7 +19,7 @@
### [react-native-pdf+7.0.2+002+fix-pdf-crash-already-closed-android.patch](react-native-pdf+7.0.2+002+fix-pdf-crash-already-closed-android.patch)

- Reason:

```
This patch fixes a fatal Android crash (java.lang.IllegalStateException: Already closed) that occurs when users navigate away from a PDF while it's still rendering.

Expand All @@ -29,3 +29,18 @@
- Upstream PR/issue: https://github.com/wonday/react-native-pdf/issues/976, https://github.com/wonday/react-native-pdf/issues/882, https://github.com/wonday/react-native-pdf/issues/830, https://github.com/wonday/react-native-pdf/pull/999
- E/App issue: https://github.com/Expensify/App/issues/82570
- PR introducing patch: https://github.com/Expensify/App/pull/82628


### [react-native-pdf+7.0.2+003+disable-topchange-coalescing-android.patch](react-native-pdf+7.0.2+003+disable-topchange-coalescing-android.patch)

- Reason:

```
This patch prevents Android Fabric from coalescing react-native-pdf's shared topChange events.

react-native-pdf sends loadComplete and pageChanged through the same topChange event name. Under Fabric, TopChangeEvent inherited React Native's default coalescing behavior, so pageChanged could replace loadComplete for the same PDF view before JS received it. That broke the onLoadComplete contract for hidden PDF validation renders. Marking the event as non-coalescible preserves both native callbacks in JS without adding an app-level success fallback.
```

- Upstream PR/issue: N/A
- E/App issue: https://github.com/Expensify/App/issues/81225
- PR introducing patch: TBD
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/node_modules/react-native-pdf/android/src/main/java/org/wonday/pdf/events/TopChangeEvent.java b/node_modules/react-native-pdf/android/src/main/java/org/wonday/pdf/events/TopChangeEvent.java
index 6feb97d..aab7738 100644
--- a/node_modules/react-native-pdf/android/src/main/java/org/wonday/pdf/events/TopChangeEvent.java
+++ b/node_modules/react-native-pdf/android/src/main/java/org/wonday/pdf/events/TopChangeEvent.java
@@ -17,6 +17,11 @@ public class TopChangeEvent extends Event<TopChangeEvent> {
return "topChange";
}

+ @Override
+ public boolean canCoalesce() {
+ return false;
+ }
+
@Nullable
@Override
protected WritableMap getEventData() {
Loading