fix: Duplicate Requests for checking if a url hosts PDF#56
Merged
OS-pedrogustavobilro merged 6 commits intomainfrom Apr 17, 2026
Merged
fix: Duplicate Requests for checking if a url hosts PDF#56OS-pedrogustavobilro merged 6 commits intomainfrom
OS-pedrogustavobilro merged 6 commits intomainfrom
Conversation
This was causing an issue on ASPX and Traditional Web Apps where multiple requests were triggering "Preparation" server action more than once when loading said web page in a WebView. Given that they weren't trying to load PDFs to begin with, this shows how checking the pdf type before loading the webpage is probably not the way to go. Instead, we use webview.setDownloadListener to listen when we receive a file that should be downloaded in the webview, and remove the checks from handleLoadUrl References: - https://outsystemsrd.atlassian.net/browse/RMET-5141 - https://success.outsystems.com/documentation/11/building_apps/application_logic/actions_in_web_applications/#preparation-actions - https://outsystems.slack.com/archives/C04ND35707P/p1776336737181489 - https://developer.android.com/reference/android/webkit/DownloadListener
Following PR comments #56 (review) Co-authored-by: OS-ruimoreiramendes <rui.moreira.mendes@outsystems.com>
OS-ruimoreiramendes
approved these changes
Apr 17, 2026
OS-pedrogustavobilro
added a commit
to OutSystems/cordova-outsystems-inappbrowser
that referenced
this pull request
Apr 17, 2026
OS-pedrogustavobilro
added a commit
to ionic-team/capacitor-os-inappbrowser
that referenced
this pull request
Apr 17, 2026
7 tasks
OS-pedrogustavobilro
added a commit
to OutSystems/cordova-outsystems-inappbrowser
that referenced
this pull request
Apr 17, 2026
* fix(android): Duplicate requests for checking if a url hosts PDF Via native library update. References: - https://outsystemsrd.atlassian.net/browse/RMET-5141 - https://outsystemsrd.atlassian.net/browse/RPM-6744 - OutSystems/OSInAppBrowserLib-Android#56 * chore(release): Prepare for version 1.6.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR moves logic for checking if a url is hosting a PDF from
handleLoadUrlto webview.setDownloadListener. Instead of us explicitly checking the mime type by doing an HTTP request to the server before loading the url, we load the url and then wait for the webview to inform us if this is a file that can be downloaded, and then check if it's a PDF there.This fixes an issue on ASPX and OutSystems Traditional Web Apps where multiple requests were triggering "Preparation" server action more than once when loading said web page in a WebView, even if the web page hosted no PDFs.
Context
References:
References:
Type of changes
Tests
To test that the issue is fixed, install and compare the two APKs (signatures may not match so you may need to uninstall one when uninstalling the other)
In your computer access https://enmobile11-dev.outsystemsenterprise.com/ServiceCenter/General_Logs.aspx, and search for RMET-5141 Callback. Open the app and press "Button IAB WebView (bug)". After a second or two refresh the logs page, you'll see three logs for the old apk, and just 1 for the new apk.
To test general behavior with IAB after this change (including open PDFs), check the sample app:
Checklist