Posts by Peter Bradstreet

Show threads by Peter Bradstreet
162 posts found, page 10 of 11

Peter Bradstreet (In thread: Some help around certain Javascript syntax)
Hi David, A huge thank you for your persistence in helping me with this. It is working for me now. Now I have to sit back and think about whether I move forward with PouchDB or go with httpclient and a MySql db. Anyway, at least I have some choices now. Thanks again, your support is fantastic! Pete

Peter Bradstreet (In thread: Some help around certain Javascript syntax)

If you can figure out how to display the find results in the record then I may stick with PouchDB. On the other hand, I have extensive experience in a product called AwareIM and have my own server. I can create a web app that handles a lot of the back-end functionality like user authorizations, mail deliveries etc... and can handle rest services so sending information back to the mobile app via json is a breeze so this might well be a viable option. My back-end database in this case would be MySql and so direct manipulation with that database or via my app are two possible options.

Most of my app functionality would not require instant synchronization and could likely be handled by http requests on entering a view etc... I do want to consider though, one to one user chat capability inside the app and I presume that this would need to use websockets? I really don't know anything about websockets. Would I need my own websocket server or are there 3rd party services available? This more traditional option does sound interesting as I would not likely be breaking new ground.


Peter Bradstreet (In thread: Some help around certain Javascript syntax)
Hi, I was just storing the various scripts in the editor and copying and pasting them into the remoteSync to test them. With respect to whether or not PouchDB is the way to go, I am certainly not married to it and am a lot more familiar with MySQL. So let me ask you this. One of my main requirements is for certain users to be able to share an 'account' so that certain records would be kept in sync at all times assuming both users are online or it would sync when they come online. For example, if I had a shopping list, and user 1 added an item to that list, them that item would instantly pop up in the same shopping list for user 2. Would that type of live-time syncing be possible in the more traditional method that you are talking about? WebSockets perhaps? Pete

Peter Bradstreet (In thread: Some help around certain Javascript syntax)

Hi, I am afraid that I am doing something centrally wrong and am getting frustrated. In order to simplify matters I have reverted to the original PouchDB project and have compiled the AB file and assets for you to look at. In the script editor you will see several saved functions:

  • remoteSync_All_Console - This returns all books into the console log properly
  • remoteSync_All_Report - This returns all books into the report properly
  • remoteSync_Find_Console - This returns just books with title = 'Book 1' into the console log properly
  • remoteSync_Find_Report - This is the one that I can't get to work
  • remoteSync - This is the one that is referenced by the view. It currently has the code from remoteSync_All_Console copied into it

I have also included in the zip file a few screen captures showing the console and report results. If you could give me a hand getting remoteSync_Find_Report working then I will be off and running as much of my app will just be other flavours of the same approach.

The assets can be downloaded Here. Cheers, Pete

Peter Bradstreet (In thread: Some help around certain Javascript syntax)

Hi, The fetch issue is due to a change in the latest pouchdb version (7.0). https://github.com/pouchdb/pouchdb/issues/7370 Apparently there is a fix but I'm not sure how to deploy the fix. I tried downgrading to version 6.4.3 and the error goes away. This version has the benefit of running in the AB preview window but for some reason although it runs in Firefox, it will not run in Chrome. However the report still does not populate although it does show in the console if I output the results there.

Apart from fixing the version 7 pouchdb error, it seems that right now it is just a case of the proper syntax to output the array. Could you take a look at this screencap and let me know how to output this data, it is for the original example with the results filtered for a particular title? https://mymarina.online/iPort/decsoft/screencap.png

Thanks, Pete

Peter Bradstreet (In thread: Some help around certain Javascript syntax)
Thanks David, I will do some more research. It seems strange that these errors only show up when I add that last bit of code I think. Anyway, sorry to make you work so late. Talk to you later. Pete

Peter Bradstreet (In thread: Some help around certain Javascript syntax)
My apologies, here is a link that works to the correct files: https://mymarina.online/iPort/decsoft/dockit.zip

Peter Bradstreet (In thread: Some help around certain Javascript syntax)
Sorry, I meant to add the ab file to the zip file but forgot. Here is a link: https://mymarina.online/iPort/decsoft.dockit.ab

Peter Bradstreet (In thread: Some help around certain Javascript syntax)
Hi, it is uploading now and will just be a few minutes. https://mymarina.online/iPort/decsoft/dockit_Compiled.zip This is the beginning of my main app. On the home screen, click on the tools icon in the top left corner and then on the notes icon. It should show the filtered list of documents. Thanks!! Pete

Peter Bradstreet (In thread: Some help around certain Javascript syntax)
Hi, I am just going to upload the zip file and send you a link. I did change the report fields and they are getting populated if I show all records rather than find(). I will report back in a minute when the file is uploaded with the download url

Peter Bradstreet (In thread: Some help around certain Javascript syntax)
Hi, I fixed a couple of small syntax issues using that method and I am not getting any errors now. the preview is working and when previewing it in Chrome, it is not populating the report with any rows but no errors are showing up in the browser console which seems strange. I realize that it is late over there so we can pick this up again tomorrow. Thanks for your help as always!

Peter Bradstreet (In thread: Some help around certain Javascript syntax)
Hi, I am still getting the same result. If I use it outputs the array to the browser window however if I replace the snippet: With when I go to preview the app I just get a blank screen. The AB console results are then:

Peter Bradstreet (In thread: Some help around certain Javascript syntax)

Hi David,

In the example that you originally sent me, I have the report field being filled properly via the following function:

However, I need to switch from using allDocs to a pouch (mango) query. I am able to successfully write the results of the query to the browser console via the following function:

The console results are as follows:

I am now trying to push this data into the data report but am struggling to find the right syntax. I was wondering if you could point me in the right direction, I can't get the following function to compile?


Peter Bradstreet (In thread: PouchDB/CouchDB offline first application example)

Hi, Yes I realize that everything that I am doing now is wide open. I plan on creating a new end point in a couple of days. I will be building in authentication as one of my early steps, There is a CouchDB plugin that will help me with this.

So far it looks like PouchDB is going to be a good solution. I am just using IndexedDB for local storage although SqlLite is possible too. The app that I am starting on needs to work without internet connection and 95% of the functionality will work in that mode. I plan on some of the functionality requiring internet connectivity such as chats between users and list synchronizations between users that share the same account. I plan on detecting whether access to the internet exists and if so, that functionality will be conditionally exposed.


Peter Bradstreet (In thread: PouchDB/CouchDB offline first application example)

I have it syncing from the local server to the remote server and back so if I open it up in firefox and chrome, the changes are showing in both browsers. It is still really rough and needs to be updating on db change, deletions etc... but I am on my way. When I have the full crud example working with live time syncing, I will certainly share it. I will let you know if I hit any roadblocks along the way.

My ultimate goal is to develop a mobile app that is offline first and syncs between users that share the same account but for now I am happy with baby steps. Thanks for your help, Pete

Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.