Multiple tabs of application with Dexie - dexie

Currently i work on project which use lovefield library for wrapping indexedDb. And if open multiple tabs of application then database will be damaged(as lovefield not handle multiple connections to db). How about Dexie? Can i use it for multiple tabs in the browser?

Related

Cypress test optimise for multiple UI behavior

In our project we serve multiple clients with the same codebase and each client is having its own configuration, so the UI is behaving as per the configuration, the configuration is saved in the database for the UI elements, we don't want to write a separate test suite for different clients, the reason is when anything gets added to all the clients we should able to update at once in one place and it should work.
Can we get guidance on how we can structure our tests so that they will read the configuration per client from the database and behave accordingly?

Is it posible to view react native source code in built applications?

I am a developer who wants to be able to make cross-platform applications and have came across Xamarin and React Native.
Since the language that Xamarin uses is C#, this means that the code has to be compiled before the application can be run. React Native, however, uses JavaScript. Since JavaScript source code can be seen on websites, and is downloaded into the webpage unlike PHP, this means that the user on the client end can easily view the source code. If the user is able to get to the source code easily and the application in question connects to a database, this means they would be able to view the password, making the application insecure.
The question is, if I where to make an application which connects to a MySQL using React Native, would the user be able to easily view the source code like they can on a webpage, or is it compiled like Xamarin is, making it harder to view the source code?
The javascript does not compile to native code. It uses a bridge to communicate between javascript/native components. JS is obfuscated but that is about it. You should not be storing any secrets client side.
See: https://github.com/facebook/react-native/issues/1093
'As #vjeux said, we have no immediate plans to add encryption for JS bundle files, and yes, under the currently recommended bundling instructions, your JS will be included as plaintext that can be extracted and de-obfuscated with relative ease.'
He goes on to mention a way to base64 encode the jsbundle to deter 'casual' hackers but then explains it will not stop a 'determined hacker'.
You should not connect the client directly to the DB. You need a secure server to handle authentication, and retrieve and validate db queries.
Nothing is secure on client. So you must validate all db queries before calling the db with them. See: https://www.acunetix.com/websitesecurity/sql-injection/ 'An SQL Injection needs just two conditions to exist – a relational database that uses SQL, and a user controllable input which is directly used in an SQL query.'
By allowing the client to directly connect to the DB, you cannot prevent the oldest of attacks.

Core Data concurrency with app extensions

I'm developing an app extension that needs to share data with the containing app. I created an app group and moved the core data store of the main app to that folder. From the extension I can create the managed object context and save data to the store and I can also access it from the containing app. Now I have two independent applications accessing the same core data store. This sounds like a recipe for disaster to me. Is what I have set up sufficient for sending data from the extension to the containing app or should I look for another way?
In this situation you'll have two entirely independent Core Data stacks accessing the same persistent store file.
Assuming that you're using SQLite, you're fine, at least as far as data integrity. Core Data uses SQLite transactions to save changes and SQLite is fine with multiple processes using the same file. Neither process will corrupt data for the other or mess up the file.
You will have to deal with keeping data current in the app. For example if someone uses the share extension to create new data while the app is running. You won't get anything like NSManagedObjectContextDidSaveNotification in this case. You'll need to find your own way to ensure you get any new updates.
In many cases you can make this almost trivial-- listen for UIApplicationDidBecomeActiveNotification, which will be posted any time your app comes to the foreground. When you get it, check the persistent store for new data and load it.
If you want to get a little more elegant, you could use something like MMWormhole for a sort-of file based IPC between the app and the extension. Then the extension can explicitly inform the app that there's new data, and the app can respond.
Very interesting answer from Tom Harrington. However I need to mention about MMWormhole. I've found that MMWormhole uses NSFileCoordinator and apple tells that:
Using file coordination in an app extension to access a container
shared with its containing app may result in a deadlock in iOS
versions 8.1.x and earlier.
What Apple suggests for safe save operations you can read here:
You can use CFPreferences, atomic safe save operations on flat
files, or SQLite or Core Data to share data in a group container
between multiple processes even if one is suspended mid transaction.
Here is the link to the Apple Technical Note TN2408.

Open multiple URLs in the one selenium ide test

I am looking to run the one test on multiple URLs using the selenium ide plugin for Firefox. My environment is load balanced, so I have the same website working on a number of servers. I will be testing internally, so I can access each server via their internal IP address (e.g. 192.168.1.1, 192.168.1.2, etc.). the purpose of the test I do is to check that servers are synchronized, by confirming that UI elements are there.
Is there a selenium command that will allow me to open a URL (e.g. 192.168.1.1), run a set of UI checks, then open the next URL (e.g. 192.168.1.2), and run the same UI checks again?
I currently change the base URL before every test to achieve this, but if I could automate this entirely, it will save me a lot of time (I have lots of different servers to hit).
Not with Selenium IDE. But you can generate code for various languages, the Selenium API in those languages do allow opening multiple, independent browser instances.

Is it possible to share one HttpSession object with multiple browser windows?

Does Tomcat absolutely guarantee that sessions and browser windows have 1-to-1 relationship? Or it is possible to have multiple windows sharing one HttpSession, for example when pressing Ctrl-N?
This is not server specific and can also not be controlled from the server side on. This is client (webbrowser) specific and can only be controlled by client side configuration (whenever available). By default, all modern browsers share the same cookies and thus also the session among all instances (all windows and tabs). Only in Chrome, you can open a new "Incognito" window using Ctrl+Shift+N which will create an entirely separate session.
See also:
How do servlets work? Instantiation, sessions, shared variables and multithreading
The session is bound to the JSESSIONID cookie, so it'll be shared across the windows from the same browser. If you want two sessions you can use two browsers side by side, like Firefox and Chrome.

Resources