Parse related remote calls failing in app - parse-platform

I have developed an Ionic Framework App using Parse which works great on my desktop browsers. No errors or warnings in the browser console.
But when I package the app and test in on my actual Android 4.4.4 device, the Parse related functionalities does not work. When I tried to debug the App by installing the .apk using GapDebug tool, I see the below in the console.
POST https://api.parse.com/1/login net::ERR_CACHE_MISS
POST https://api.parse.com/1/requestPasswordReset net::ERR_CACHE_MISS
Below is the complete console log details for the Parse Login activity.
POST https://api.parse.com/1/login net::ERR_CACHE_MISS parse-1.3.3.min.js:1
b._ajax parse-1.3.3.min.js:1
b._request parse-1.3.3.min.js:1
b.User.b.Object.extend.logIn parse-1.3.3.min.js:3
b.User.b.Object.extend.logIn parse-1.3.3.min.js:3
$scope.validateUser login.controller.js:22
$parseFunctionCall ionic.bundle.js:20124
(anonymous function) ionic.bundle.js:50863
Scope.$eval ionic.bundle.js:22178
Scope.$apply ionic.bundle.js:22276
(anonymous function) ionic.bundle.js:50862
jQuery.event.dispatch jquery.js:4409
elemData.handle jquery.js:4095
triggerMouseEvent ionic.bundle.js:2811
tapClick ionic.bundle.js:2800
tapTouchEnd ionic.bundle.js:2918
POST https://api.parse.com/1/requestPasswordReset net::ERR_CACHE_MISS
For getting all the data for a particular class, I get the below failure object.
Failed to load resource: net::ERR_CACHE_MISS https://api.parse.com/1/Items
XMLHttpRequest failed: {"statusText":"","status":0,"response":"","responseType":"","responseXML":null,"responseText":"","upload":{"ontimeout":null,"onprogress":null,"onloadstart":null,"onloadend":null,"onload":null,"onerror":null,"onabort":null},"withCredentials":false,"readyState":4,"timeout":0,"ontimeout":null,"onprogress":null,"onloadstart":null,"onloadend":null,"onload":null,"onerror":null,"onabort":null}

The issue was with permission. It was failing because the app was not able to connect to internet.
Somehow the Network Access permission entry got deleted in the manifest file. After adding it to manifest, it worked.

Related

WKWebView in Blackberry Dynamics iOS app cannot save cookies

We have a Xamarin.iOS app which uses the Blackberry Dynamics SDK. (v11.0.1.11)
In this app we show a WKWebView, which loads a page that uses cookie based authentication. The problem is, that cookies seem not to be correctly saved. During loading of the WKWebView I see entries like this in the console output:
2023-01-17 13:16:34.765 MyApp[1110:277171] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/7FB9EDEF-FB4A-4E7B-A8B0-E02C209D1F20/Library/Cookies/Cookies.binarycookies
2023-01-17 13:16:34.779 MyApp[1110:277171] could not create directory "/private/var/mobile/Containers/Data/Application/7FB9EDEF-FB4A-4E7B-A8B0-E02C209D1F20/Library/Cookies" for future sandbox extension, error Error Domain=NSCocoaErrorDomain Code=516 "The file “Cookies” couldn’t be saved in the folder “Library” because a file with the same name already exists." UserInfo={NSFilePath=/private/var/mobile/Containers/Data/Application/7FB9EDEF-FB4A-4E7B-A8B0-E02C209D1F20/Library/Cookies, NSUnderlyingError=0x28237d8f0 {Error Domain=NSPOSIXErrorDomain Code=17 "File exists"}}
Then when the WebView loads it gets a "401 - Unauthorized" from the server because (I assume) the cookie is missing. Doing the same in our version of the app not using the Blackberry SDK we do not get this log entry and the page loads without problems. Any idea why cookies cannot be saved in the Blackberry version?

Cypress detects cross origin error on test that does not leave main origin

I've been running into a problem with Cypress (currently v8.3.1 but this has been a constant for years) where my test detects a cross origin error on page load, but I am 99% certain that shouldn't apply.
The test logs into a web application and attempts to access a project.
cy.visit(webapp) //login page
cy.login(userCreds) //enter user cred and access main page
cy.get(projectAcccessButton).click() //access project from main
As the project page loads, Cypress throws the cross origin error below. I've been using the "chromeWebSecurity": false workaround, but it does not apply to Firefox. Firefox test coverage is on the "2022 To Do" list, so I am turning to Stack for answers - I hope.
What I want to do: Access the project page without issue.
What has been happening: cross origin error on page load
Permission denied to access property "document" on cross-origin object
I mentioned that the cross origin error likely shouldn't apply because when I modify the test to access the project page via cy.visit(), Cypress does not throw an error.
cy.visit(webapp) //login page
cy.login(userCreds) //enter user cred and access main page
cy.visit(projectPage) //access project via url
This leads me to believe something is happening on the button click that is somehow triggering the cross origin error. Is it possible that the button attribute onclick="window.location.href='/projectManager/123456789'" is somehow being interpreted as leaving the main origin?
If this error is related to the window.location.href, how can I resolve this so Cypress doesn't detect an error when running in Firefox?
Full Error Message:

Optimizely object is not valid. Failing isFeatureEnabled

I'm trying to use the React and JavaScript SDKs for Optimizely, but getting the following error in the console:
OPTIMIZELY: Optimizely object is not valid. Failing isFeatureEnabled.
More info about my setup below:
Installed via Yarn: yarn add #optimizely/react-sdk
Import statement in the app container:
import {
createInstance
} from '#optimizely/react-sdk'
Logic in render function:
const optimizely = createInstance({
sdkKey: '<SDK_KEY>',
})
const enabled = optimizely.isFeatureEnabled('example_feature', 'user123');
I get this error in the Chrome console:
OPTIMIZELY: Optimizely object is not valid. Failing isFeatureEnabled.
The Optimizely object will log that error when you call isFeatureEnabled before the SDK has successfully loaded your project's datafile. This can happen for a number of reasons outlined below. Looking at the code example provided in the question, it looks like reason #4 is the most likely cause of the error, but here are all of them:
1. Bad SDK key
If you pass in a bad SDK Key to createInstance, the SDK will not successfully load the datafile and you will get this error.
const optimizely = createInstance({
sdkKey: 'invalid-sdk-key'
})
2. Malformed datafile
If you are passing in the datafile directly to createInstance, but pass in an object that isn't the proper datafile format, you will get this error:
const optimizely = createInstance({
datafile: { wrong: 'format' }
})
3. Inaccessible datafile
Make sure you can access the url of your datafile in a web browser: https://cdn.optimizely.com/datafiles/<Your_SDK_Key>.json. If you get an AccessDenied (403) or Not Found (404) error and your account is new, make sure you create something in the Optimizely UI so that Optimizely is triggered to create and upload a proper datafile.
If in the console of your running application you see a 403 or 404 for the request to the datafile, ensure there are no ad-blockers, firewalls, or proxies preventing the SDK from requesting the datafile on Optimizely's CDN from the SDK.
4. Not waiting for Optimizely SDK to be ready
Even if you have the right SDK Key and the SDK can access Optimizely's CDN. If you don't give the SDK enough time for the datafile request to finish, you will be trying to use the SDK before it's ready.
In the JavaScript SDK, this can be solved by using the onReady method:
const optimizely = createInstance({
sdkKey: 'valid-sdk-key',
});
optimizely.onReady().then(() => {
// optimizely is ready to use, with datafile downloaded from the Optimizely CDN
});
If using the <OptimizelyFeature> component of the React SDK, then the <OptimizelyFeature> component will automatically wait until the <OptimizelyProvider> has successfully loaded the datafile before evaluating isFeatureEnabled.
My Firefox console error was
[OPTIMIZELY] - ERROR <timestamp> OPTIMIZELY: Optimizely object is not valid. Failing isFeatureEnabled.
One of my network failures gave me a big clue. The GET request for cdn.optimizely.com showed "Blocked by AdBlocker Ultimate" under the Transferred column.
Solution
I turned off my ad blocker for this site.

Unhandled Promise Rejection: Error: Untrusted URL when I load Youtube video inside WebView on JavaFX

When I load a Youtube video using WebView directly from YT, I get all the page data, but the video stays charging without showing the video itself. This issue is new because the previous week that worked adequately.
I suppose that Youtube has made some changes to prevent embedding video pages inside JavaFX WebView component.
Please use the following repository to see a test.
https://bitbucket.org/diegoluisr/javafx-webview-youtube-test/src/master/enter link description here
WebKit browser prints in the console the following lines...
Console: [https://www.youtube.com/yts/jsbin/player_ias-vflPI0brM/en_US/base.js:39] Unhandled Promise Rejection: Error: Untrusted URL: https://r3---sn-qpgxju8jva-cvbe.googlevideo.com/videoplayback?expire=1564559165&ei=3PJAXYPFN7n6j-8Podm9WA&ip=191.102.199.174&id=o-AFpZ9-9BjKhhYLbO9zoBJ-koAlgU4_rl5mhm-RAcZPp2&itag=22&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-qpgxju8jva-cvbe%2Csn-hp57knly&ms=au%2Crdu&mv=m&mvi=2&pl=24&ctier=L&initcwndbps=236250&mime=video%2Fmp4&ratebypass=yes&dur=10.100&lmt=1563964109911459&mt=1564537439&fvip=2&c=WEB&txp=5316222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cctier%2Cmime%2Cratebypass%2Cdur%2Clmt&sig=ALgxI2wwRgIhAND23sayeeFGInqso6n2wt5VI1-8CmEwn3BS7KEqdFZ0AiEAokZIzzORQLnQLDhnoUmK6gSJP1FxDnpJAIcPNOVxoxg%3D&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRQIgH9Mxi8qnf2E1yvcvfA8gjeJTBKe_kKBklEhjz82gWK4CIQCX6D8qZbu-Dpy-NkCRcluo-OOLSzuu8mgEwgni5_8RFA%3D%3D
Console: [https://www.youtube.com/yts/jsbin/player_ias-vflPI0brM/en_US/base.js:39] Unhandled Promise Rejection: Error: Untrusted URL: https://r4---sn-qpgxju8jva-cvbe.googlevideo.com/videoplayback?expire=1564559175&ei=5_JAXe6MCoS2lAOI14eoBA&ip=191.102.199.174&id=o-ALfOT4rp_IeL6a86s4a2nTlmva4YgQkA9yc_o-ma4_hG&itag=22&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-qpgxju8jva-cvbe%2Csn-hp57knzz&ms=au%2Crdu&mv=m&mvi=3&pl=24&ctier=L&initcwndbps=236250&mime=video%2Fmp4&ratebypass=yes&dur=119.559&lmt=1563514693761974&mt=1564537439&fvip=4&c=WEB&txp=5316222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cctier%2Cmime%2Cratebypass%2Cdur%2Clmt&sig=ALgxI2wwRQIhAI-C_mVNjdJNzAK249RkB62Blm7jw1_FjwQvkebmhCMUAiBOzmlsdMCZriM9VSmcAVM-BzxzGpcK49kHGg8izPQfVA%3D%3D&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRAIgMRZJB2yOLTSlIgblsfaMsK56HcO6MQ6bklYQDnLczM4CIGXeJsTlmhBTDodytkm2jO5Gc6SmY6Q6sjQmwVrUXnvH
Console: [https://www.youtube.com/yts/jsbin/player_ias-vflPI0brM/en_US/base.js:39] Unhandled Promise Rejection: Error: Untrusted URL: https://r2---sn-qpgxju8jva-cvbe.googlevideo.com/videoplayback?expire=1564559162&ei=2vJAXYWoHOXbj-8Prs-DgAo&ip=191.102.199.174&id=o-AO7C5x6ZIyPXAr2qK_vIPflPjs-AOMY2IJVZliAV72Cp&itag=18&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-qpgxju8jva-cvbe%2Csn-hp57kn6e&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=236250&mime=video%2Fmp4&gir=yes&clen=19015393&ratebypass=yes&dur=348.856&lmt=1537207191333104&mt=1564537439&fvip=2&c=WEB&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cmime%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRQIgW0bSjfFcOWJAwx2_jlafwhDh5-QSE4QaHLllKQUCoXgCIQCcEWzrSiuhAAj9ibUukTnM9_Z7Ln8u8ZbxH4gfqid-fw%3D%3D
You could notice three console lines, that is because the player tried to load 2 Advertising video before the "Alice in Chains" video.
I solve my problem working around it; I have to use a commercial component named JxBrowser. This component uses a chromium implementation (version 69) that allows the embed player to work, and disable gestures required to autoplay.
You could find more information on the component website
https://www.teamdev.com/jxbrowser

I can't add items from any dashboard (old or new)

I'm trying tu turn on and test ScadaLTS on my PC (Windows 10). Before read install instuctions, I have donwloaded and installed Tomcat and MySQL, configured context.xml and env.properties. I have restarted Tomcat before changes and navigated to localhost. All seems to work well. Login pagin is showed and I can log in with 'admin/admin'. I click on add view and new view is created. I go to edit button. When I try to add a new component, only two options appear (SLTS Image Componen and SLTS Visit Counter). If I back to old UI, add a view and then try to add a component, list is published as shown is youtube, but when I click on add, nothing happens. No items are added on drawable surface.
I was looking for errors in Tomcat log folder but nothing find. If I open Angular 2 UI with dev-tools, console show firtsly two erros:
Failed to load resource: the server responded with a status of 404 (Not found) ~https://fonts.googleapis.com/icon?family=Material+Icons
Failed to load resource: the server responded with a status of 404 (Not found) ~#angular/material/prebuilt-themes/deeppurple-amber.css
And before them, two more are shown continously:
ERROR TypeError: Cannot read property '_has' of undefined
at p (plotly.min.js:52)
at Object.t [as relayout] (plotly.min.js:52)
at WatchlistComponent.webpackJsonp.../../../../../src/app/appBody/watchlist/watchlist.component.ts.WatchlistComponent.autorangeChart (main.bundle.js:3859)
at main.bundle.js:3635
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (vendor.bundle.js:33289)
at Object.onInvokeTask (vendor.bundle.js:81064)
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (vendor.bundle.js:33288)
at Zone.webpackJsonp.../../../../zone.js/dist/zone.js.Zone.runTask (vendor.bundle.js:33056)
at webpackJsonp.../../../../zone.js/dist/zone.js.ZoneTask.invokeTask (vendor.bundle.js:33363)
at ZoneTask.invoke (vendor.bundle.js:33352)
defaultErrorLogger # vendor.bundle.js:78203
:8080/ScadaBR/api/point_value/getValue/null Failed to load resource: the server responded with a status of 400 (Bad request)
vendor.bundle.js:78203 ERROR Error: Uncaught (in promise): Response with status: 400 Petición incorrecta for URL: http://localhost:8080/ScadaBR/api/point_value/getValue/null
at resolvePromise (vendor.bundle.js:33648)
at resolvePromise (vendor.bundle.js:33619)
at vendor.bundle.js:33696
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (vendor.bundle.js:33289)
at Object.onInvokeTask (vendor.bundle.js:81064)
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (vendor.bundle.js:33288)
at Zone.webpackJsonp.../../../../zone.js/dist/zone.js.Zone.runTask (vendor.bundle.js:33056)
at drainMicroTaskQueue (vendor.bundle.js:33460)
at ZoneTask.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (vendor.bundle.js:33367)
at invokeTask (vendor.bundle.js:34235)
Could you help me please? Thanks in advance
Which version of Java, Tomcat and MySQL are you using?
The problem can be caused by too high version of Tomcat. We recommend to use version 7.0.82.
The simplest way to run Scada-LTS is to use our docker container:
https://github.com/SCADA-LTS/Scada-LTS/wiki/Run-ScadaLTS-on-docker---instruction

Resources