Is there a bug with Worklight on IE 10? - ibm-mobilefirst

I've been working with a business partner to get an insurance app working on a Windows 8 tablet and have come across some interesting behavior that I can't explain.
I have managed to recreate the problem using a very simple use case and it appears to fail in the browser as well as when deployed as an app.
To re-create
Create a simple WL Hello World app with no JavaScript libraries
Deploy it to the development server
Open up an IE 10 browser and launch the WL Console.
Run this app using "Preview as Common Resources" and it should work fine (showing the default Hello Worklight)
click F12 to launch the IE debugger and then refresh the browser, click on the show console button to verify there were no errors
Add a WL.Client.connect(...) call into the wlCommonInit method
...
WL.Client.connect({
onSuccess: function(data) {
console.log("connection Successful");
},
onFailure: function(err) {
console.log("Connection FAILED: " + JSON.stringify(err) );
}
});
Save and re-run the app and it fails with an InvalidStateError (verify with F12 debugger)
Open up either a Chrome or Firefox browser to the WL Console page and click the "Preview as Common Resources" and open the developer tools for either and the console shows the connect call succeeding.
Is this a known problem or is there something that I've missed?
The ultimate goal is to deliver a Windows 8.1 tablet app however every time we tried to run the app it failed with this error. After some debugging I thought maybe it has something to do with the OS and tried to replicate it in just the browser with minimum code.
Through testing I've found that the basic Hello Worklight app with a WL.Client.connect() fails on IE but works on other browsers.
So I'm thinking if I get it working in IE browser, then that fix will be good for the tablet app as well.
Any pointers or guidance would be appreciated.
Note I am using WL v6.2 (6.2.0.00-20140915-1601)
Tested on Windows 7 - IE 10.0.9200.17089
Tested on Windows 8.1 - IE 11.0.9600.16663
The error I get is
HTML1300: Navigation occurred.
File: index.html
wlclient init started
before: initOptions.onSuccess
Request [/Connect/apps/services/api/Connect/common/init]
console.trace()
at __log (http://192.168.80.167:10080/Connect/apps/services/preview/Connect/common/0/default/worklight/worklight.js:4882:31)
at Anonymous function (http://192.168.80.167:10080/Connect/apps/services/preview/Connect/common/0/default/worklight/worklight.js:5240:7)
at createRequestHeaders (http://192.168.80.167:10080/Connect/apps/services/preview/Connect/common/0/default/worklight/worklight.js:3200:17)
at sendRequest (http://192.168.80.167:10080/Connect/apps/services/preview/Connect/common/0/default/worklight/worklight.js:3266:18)
at initialize (http://192.168.80.167:10080/Connect/apps/services/preview/Connect/common/0/default/worklight/worklight.js:3172:17)
at klass (http://192.168.80.167:10080/Connect/apps/services/preview/Connect/common/0/default/worklight/worklight.js:524:4)
at sendInitRequest (http://192.168.80.167:10080/Connect/apps/services/preview/Connect/common/0/default/worklight/worklight.js:7870:5)
at connect (http://192.168.80.167:10080/Connect/apps/services/preview/Connect/common/0/default/worklight/worklight.js:7879:3)
SCRIPT5022: InvalidStateError
File: worklight.js, Line: 1055, Column: 3
Uncaught Exception: InvalidStateError at (compiled_code):1055

For future readers, this problem was resolved by moving to a newer fixpack release v6.2.0.00-20141002

Related

[PWA][NEXT.JS][iOS] I sometimes cannot get data from server. The error message is FetchEvent.respondWith received an error: no-response: no-response

My PWA app sometimes cannot get data from server. It shows errors like:
FetchEvent.respondWith received an error: no-response: no-response
Fetch API cannot load
no internet connection
[](https://i.stack.imgur.com/ZcBm4.png)
But if we reload the page, it could get data normally. And these bugs only happened in Safari. It is working well in Chrome or window devices.
I reference some page. But I don't know these bugs caused by BE settings (CORS) or Safari.
My devices I am testing is iPhone XS, iOS 14.4
And I am using the newest 'next-pwa' version which means the workbox version is 6.5.4
"workbox-webpack-plugin": "^6.5.4",
"workbox-window": "^6.5.4"
Referenced Pages:
https://github.com/GoogleChrome/workbox/issues/1730
https://www.adro.codes/vault/pwa-fetch-respondwith-error-safari
Service Worker FechtEvent.respondWith response is null on iOS 12.1 Safari

How can I debug a websocket connection?

When running within a testcafe test, upon loading an app that tries to connect to a websocket, I receive an error in the console of "Connection closed before receiving a handshake response"
This prevents most of the app from working.
How can I get additional information about what the final request that testcafe is making after url-rewriting? I'd like to see exactly what url & headers it's sending to try to connect.
Simple example:
import { ClientFunction, Selector } from "testcafe";
fixture`Getting Started`.page("https://torus.qa.argos.education/session/new");
test("Example error", async (t) => {
await t.debug();
});
I've tried chrome with both non ssl and self signed certificate mode, and also tried disabling web security. Firefox gives the same error.
We released a new TestCafe version (v2.3.0), which includes experimental proxyless mode. This mode uses native browser automation. In Proxyless mode, a few issues are already fixed. This issue should also be fixed in Proxyless mode.
Unfortunately, I was not able to test your web site since the URL you shared is no longer available. Would you please check if your sample is working correctly in v2.3.0 with experimental proxyless mode enabled?
This option is available in all interfaces:
// Command-line
testcafe chrome tests --experimental-proxyless
// Programmatic
const testcafe = await createTestCafe({ experimentalProxyless: true });
// Configuration file
{
"experimentalProxyless": "true"
}
Please keep in mind that this mode is still experimental and is implemented only in Google Chrome. It will not work correctly if you run tests in a non-Chrome browser or in a combination of other browsers.

How to run test in IE browser using OxygenHQ?

I want to run a simple test using OxygenHQ, of opening wikipedia and then search for hello world. The script written is working fine for Chrome and Firefox but in case of IE mutiple windows are opening without the page and then it fails eventually.
Is there any way to fix this? I went through the docs provided at http://docs.oxygenhq.org/guide-web-intro.html but could not get a concrete answer on why this is only happening for IE. Here is a console output and screenshot for reference.
Console Output :
Initializing...
Starting iteration #1
UNKNOWN_ERROR - undefined: args[0].endsWith is not a function at line 1Test finished with status --> FAILED
Details:
Browser: Internet Explorer
Version: 11.535.18362.0
OS: Windows 10
This might be connected to your internet settings
make sure that the IE screen size is 100%
make sure all Internet options in Security Tab (Internet, Local Internet etc') are either with the Enable protected mode on or off (should be the same for all)
see picture
Have a look again at the Oxygen web site, it has had a major facelift and a lot of new content

Created simple App with WL.Client.connect and mobile web environment, see "Access Denied" when running it on the preview and actual device

Created a simple hybrid app. Only have the following in the code
main.js
function wlCommonInit() {
WL.Client.connect({
onSuccess: function() {alert ("OK");},
onFailure: function (string) {alert ("fail" + string);}
});
}
I created a mobile web environment.
After I did a Build All Environment, Run it on the Server.
I right click on the mobile web environment > Preview
I kept getting a pop up alert saying "Access Denied" with a button named reload
I moved to my iphone and in the safari, typed in the URL for the mobile web. I got exactly the same error on my iphone.
Please assist.
You haven't told us what version of MobileFirst Platform Foundation you are using, but I am guessing that it is 7.1.
In 7.1, a new Session-Independent Mode was introduced, and is turned on by default. However, session-independent mode is not supported in browser-based environments (such as mobile web). If you try to use an app that's configured for session-independent mode in an environment that doesn't support it, you will get this error. If you want to create an app in 7.1 that uses a browser-based environment, you'll need to disable session-independent mode.
If you go into your project's "worklight.properties" file, set (or change) these values:
mfp.session.independent=false
mfp.attrStore.type=HttpSession
and then rebuild/deploy your project, it should work.
Please see the doc page I've linked above for further information about session-independent mode.

Direct update on iPad to Worklight Studio development server on Windows not working

I want to develop on my Windows machine and push my changes to an iPad (iOS 7.1.2) test device via direct update. This worked for me in WL 6.1, but since my update to WL 6.2 I'm having some issues. Following scenario describes my problem.
Create new WL project and add iPad as environment
Enabled worklightSettings in application-descriptor.xml
Add the code snippet below to main.js
Run on Worklight Development Server
Open project in Xcode via eclipse
Clean project in Xcode and run on iPad
Make a change, re-deploy and verify Direct Update is received
Copy the project to a Windows machine and open in eclipse
Run on Worklight Development Server on Windows machine
Open the app settings via Settings.app and enable use Custom Server URL
Replace the IP of your mac by the IP of your windows machine
On windows: Make a change and re-deploy
Restart the app on the iPad
The moment I restart my app I get the following exception in my In the worklight development server console on my Windows machine:
[WARNING ] SRVE0190E: File not found: //apps/services/api/HelloDirectUpdate/ipad/init
[ERROR ] FWLSE0048E: Unhandled exception caught: SRVE0190E: File not found: //apps/services/api/HelloDirectUpdate/ipad/init
When I modify the custom server URL and I remove the last slash, I get the message that an update is available. But when I click update the progress bar in the downloading popup doesn't move. My Windows machine and MAC both have the following WL Studio version: platformVersion="6.2.0.00.20140724-2139". What am I doing wrong?
main.js
function wlCommonInit(){
WL.Client.connect({
onSuccess: onConnectSuccess,
onFailure: onConnectFailure
});
}
function onConnectSuccess() {
WL.Logger.debug("Connect success.");
}
function onConnectFailure() {
WL.Logger.debug("Connect failed.");
}
This is indeed a defect in Worklight 6.2.
On the one hand, as you mention in your reproduction steps you need to remove the forweawrd slash from the custom server URL in order to be able to connect to the Worklight Server (because otherwise there are 2 slashes in the URL and it fails connecting).
On the other hand, the client requires this forward slash.
You can see this in Wireshark:
Bad: GET /test3directUpdate/test3/iphone/1.0?skin=default HTTP/1.1
Good: GET /test3/directUpdate/test3/iphone/1.0?skin=default HTTP/1.1
I've opened a defect for this; you will need to create a PMR in order to receive a fix, once available (or wait until it is publicly available via IBM Fix Central / Eclipse Marketplace).