#1 2015-12-30 09:34:08

RaelB
Member
Registered: 2010-08-04
Posts: 49

SmartMobileStudio client (Example 29)

Hi,

I am trying out this example, but run into a problem.

First I compile and run RegressionTestsServer (from "27 - CrossPlatform Clients").

(I copy the crossplatform units to the SMS libraries folder)

Then I run the WebForm.sproj (from "29 - SmartMobileStudio Client") and run it in the browser.

From the browser console it looks like the app is not working: Here is (part of) the output from Firefox:

no element found DropTable:1:1
no element found 16:1:1
no element found 32:1:1
no element found 48:1:1
no element found 64:1:1
no element found 80:1:1
no element found 82:1:1
no element found 96:1:1
no element found 112:1:1
no element found 128:1:1
no element found 144:1:1
no element found 160:1:1
no element found 164:1:1
no element found 176:1:1
no element found 192:1:1
GET
XHR
http://127.0.0.1:888/root/People/16 [HTTP/1.1 404 Not Found 5ms]
GET
XHR
http://127.0.0.1:888/root/People/32 [HTTP/1.1 404 Not Found 5ms]
GET
XHR
http://127.0.0.1:888/root/People/48 [HTTP/1.1 404 Not Found 5ms]
GET
XHR
http://127.0.0.1:888/root/People/64 [HTTP/1.1 404 Not Found 5ms]
GET
XHR
http://127.0.0.1:888/root/People/80 [HTTP/1.1 404 Not Found 4ms]
GET
XHR
http://127.0.0.1:888/root/People/96 [HTTP/1.1 404 Not Found 5ms]
GET
XHR
http://127.0.0.1:888/root/People/112 [HTTP/1.1 404 Not Found 4ms]
GET
XHR
http://127.0.0.1:888/root/People/128 [HTTP/1.1 404 Not Found 4ms]
GET
XHR
http://127.0.0.1:888/root/People/144 [HTTP/1.1 404 Not Found 5ms]
GET
XHR
http://127.0.0.1:888/root/People/160 [HTTP/1.1 404 Not Found 4ms]
GET
XHR
http://127.0.0.1:888/root/People/176 [HTTP/1.1 404 Not Found 5ms]
GET
XHR
http://127.0.0.1:888/root/People/192 [HTTP/1.1 404 Not Found 5ms]

The returned json from request is

{
"errorCode":403,
"errorText":"Forbidden"
}

So looks like there is an authentication problem?

In RegressionTestsServer.dpr I could not see any code where a user "User/synopse" is created...

Any hints of what is wrong?

Thanks
Rael

(Using latest mORMot and D7)

Offline

#2 2015-12-30 16:35:31

RaelB
Member
Registered: 2010-08-04
Posts: 49

Re: SmartMobileStudio client (Example 29)

Project14ServerHttpWrapper was working with Project14Client.sproj.

I see Project14ServerHttpWrapper calls:
aServer := TSQLRestServerFullMemory.Create(aModel,'test.json',false,true);

RegressionTestsServer project calls:
DB := TCustomServer.Create(Model);

Should it not be loading the 'test.json' file (with user info) for the authentication to be working correctly?

Offline

#3 2015-12-30 17:36:54

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,242
Website

Re: SmartMobileStudio client (Example 29)

If the user info is not there, default expected values would be generated and used.

Offline

#4 2015-12-31 09:22:42

RaelB
Member
Registered: 2010-08-04
Posts: 49

Re: SmartMobileStudio client (Example 29)

1) Can anyone out there reproduce the problem I have mentioned?

2) @Arnaud: I tried to use TSQLRestServerDB instead of TSQLRestServerFullMemory so I may be able to better track what happens at the server.

I create with:
  DB := TCustomServer.Create(Model, ChangeFileExt(paramstr(0),'.db3'));  // inherits from TSQLRestServerDB
  DB.CreateMissingTables();

When I inspect the db, no default users are created. Is that only for TSQLRestServerFullMemory ?

3) I did some tracing, it looks the the "errors" are occurring in the ORMTest calls to client.delete and client.update. The initial add/read operations work ok.

Offline

#5 2015-12-31 12:33:34

RaelB
Member
Registered: 2010-08-04
Posts: 49

Re: SmartMobileStudio client (Example 29)

Ok I found answer to 2). I need to include third parameter = true.

Offline

#6 2015-12-31 15:56:22

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,242
Website

Re: SmartMobileStudio client (Example 29)

Take a look at the regression tests.
Every 1/16th item is deleted, then checked that it has been deleted.
So you see "no element found #:1:1" - which is expected.

If there is a real issue, there would be an explicit TEST FAILED message.
So everything sounds OK to me.

Offline

Board footer

Powered by FluxBB