ForestAdmin / forest-express-sequelize

🌱 Express/Sequelize agent for Forest Admin to integrate directly to your existing Express/Sequelize backend application.
https://www.forestadmin.com
GNU General Public License v3.0
190 stars 48 forks source link

[*] Pagination - Only one page of table results shows up in Forest #292

Open haneefghanim opened 5 years ago

haneefghanim commented 5 years ago

Expected behavior

Not sure if this is the right place to report, but: Forest should allow me to paginate through the different DB tables.

Actual behavior

Forest only shows one page of results, and the pagination button show 1/0 pages.

Screen Shot 2019-07-17 at 12 08 17 PM

Failure Logs

No failure logs.

Context

We're running Node v10.15.3. This seems like it might have started after upgrading to Forest v3, but I'm not sure.

arnaudbesnier commented 5 years ago

Hi @haneefghanim,

This is a basic feature of Forest Admin, so if there is an issue it might be "edge case". Can you provide some context about the issue:

Thanks for your help.

haneefghanim commented 5 years ago

Hi @arnaudbesnier, thx for the quick response! Yes, this issue is happening on all tables. As for the table size, they vary. Biggest one has about ~180k rows. Smallest have a few hundred rows.

arnaudbesnier commented 5 years ago

Thanks @haneefghanim,

Ok then it might be related to a compatibility issue with PostgreSQL 11? Don't you have any error log in the browser console or you backend that could give us some hints?

haneefghanim commented 5 years ago

No problem @arnaudbesnier! Unfortunately I'm not seeing any errors in the backend logs or the browser console. If it helps, here's the API call and the SQL query that Forest seems to be generating:

1|backend  | ip=::ffff:99.239.61.31 time=2019-07-17T16:52:59.930Z method=OPTIONS path="/forest/Annotation?fields%5BAnnotation%5D=id%2Ccomment%2CtargetSelector%2CtargetOffsetX%2CtargetOffsetY%2Cpath%2CfullUrl%2CuserName%2Cresolved%2CavatarUrl%2Cmetadata%2CscreenshotUrl%2CcreatedAt%2CupdatedAt%2CdeletedAt%2CTunnel%2CUser%2CimageVersionNumber%2CTunnelImage&fields%5BTunnelImage%5D=name&fields%5BTunnel%5D=id&fields%5BUser%5D=name&page%5Bnumber%5D=1&page%5Bsize%5D=10&searchExtended=0&sort=-id&timezone=America%2FToronto" status=204 content_length=0 content_type= elapsed=1ms
1|backend  | Executing (default): SELECT "Annotation"."id", "Annotation"."comment", "Annotation"."targetSelector", "Annotation"."targetOffsetX", "Annotation"."targetOffsetY", "Annotation"."path", "Annotation"."fullUrl", "Annotation"."userName", "Annotation"."resolved", "Annotation"."avatarUrl", "Annotation"."metadata", "Annotation"."screenshotUrl", "Annotation"."imageVersionNumber", "Annotation"."createdAt", "Annotation"."updatedAt", "Annotation"."deletedAt", "Annotation"."TunnelId", "Annotation"."UserId", "Annotation"."TunnelImageId", "Tunnel"."id" AS "Tunnel.id", "Tunnel"."subdomain" AS "Tunnel.subdomain", "Tunnel"."localUrl" AS "Tunnel.localUrl", "Tunnel"."initialPath" AS "Tunnel.initialPath", "Tunnel"."onlineStatus" AS "Tunnel.onlineStatus", "Tunnel"."password" AS "Tunnel.password", "Tunnel"."title" AS "Tunnel.title", "Tunnel"."thumbnailUrl" AS "Tunnel.thumbnailUrl", "Tunnel"."passwordEnabled" AS "Tunnel.passwordEnabled", "Tunnel"."isPublic" AS "Tunnel.isPublic", "Tunnel"."isStaging" AS "Tunnel.isStaging", "Tunnel"."readOnlyDate" AS "Tunnel.readOnlyDate", "Tunnel"."type" AS "Tunnel.type", "Tunnel"."createdAt" AS "Tunnel.createdAt", "Tunnel"."updatedAt" AS "Tunnel.updatedAt", "Tunnel"."deletedAt" AS "Tunnel.deletedAt", "Tunnel"."UserId" AS "Tunnel.UserId", "User"."id" AS "User.id", "User"."username" AS "User.username", "User"."name" AS "User.name", "User"."email" AS "User.email", "User"."avatarUrl" AS "User.avatarUrl", "User"."githubId" AS "User.githubId", "User"."githubToken" AS "User.githubToken", "User"."socketId" AS "User.socketId", "User"."password" AS "User.password", "User"."isGuest" AS "User.isGuest", "User"."emailSettings" AS "User.emailSettings", "User"."token" AS "User.token", "User"."createdAt" AS "User.createdAt", "User"."updatedAt" AS "User.updatedAt", "User"."deletedAt" AS "User.deletedAt", "User"."TeamId" AS "User.TeamId", "TunnelImage"."id" AS "TunnelImage.id", "TunnelImage"."position" AS "TunnelImage.position", "TunnelImage"."name" AS "TunnelImage.name", "TunnelImage"."url" AS "TunnelImage.url", "TunnelImage"."thumbnailUrl" AS "TunnelImage.thumbnailUrl", "TunnelImage"."versionNumber" AS "TunnelImage.versionNumber", "TunnelImage"."pastVersions" AS "TunnelImage.pastVersions", "TunnelImage"."createdAt" AS "TunnelImage.createdAt", "TunnelImage"."updatedAt" AS "TunnelImage.updatedAt", "TunnelImage"."deletedAt" AS "TunnelImage.deletedAt", "TunnelImage"."TunnelId" AS "TunnelImage.TunnelId", "TunnelImage"."UserId" AS "TunnelImage.UserId" FROM "Annotations" AS "Annotation" LEFT OUTER JOIN "Tunnels" AS "Tunnel" ON "Annotation"."TunnelId" = "Tunnel"."id" AND ("Tunnel"."deletedAt" > '2019-07-17 16:52:59.971 +00:00' OR "Tunnel"."deletedAt" IS NULL) LEFT OUTER JOIN "Users" AS "User" ON "Annotation"."UserId" = "User"."id" AND ("User"."deletedAt" > '2019-07-17 16:52:59.971 +00:00' OR "User"."deletedAt" IS NULL) LEFT OUTER JOIN "TunnelImages" AS "TunnelImage" ON "Annotation"."TunnelImageId" = "TunnelImage"."id" AND ("TunnelImage"."deletedAt" > '2019-07-17 16:52:59.971 +00:00' OR "TunnelImage"."deletedAt" IS NULL) WHERE (("Annotation"."deletedAt" > '2019-07-17 16:52:59.971 +00:00' OR "Annotation"."deletedAt" IS NULL)) ORDER BY "Annotation"."id" DESC LIMIT 10 OFFSET 0;
arnaudbesnier commented 5 years ago

You should also have a count request that will respond the total number of "Annotation" rows. In the network section of your browser console, do you observe such request?

Also, do you see the first 10 records displayed in your table view?

haneefghanim commented 5 years ago

@arnaudbesnier Yeah I'm seeing the first 10 records displayed. As for the count request, I'm not seeing that go out in the network section of the browser console. I do see the request to fetch the "Annotation" rows though.

arnaudbesnier commented 5 years ago

@haneefghanim I was trying to look at the data from our side. I guess your rendering id is 16210. Do you confirm?

If this is the right id, we are still detecting a usage of the liana v1.5.6. But you mentioned that you upgraded to v3. Did you follow the upgrade note: https://docs.forestadmin.com/documentation/how-tos/upgrade-to-v3

haneefghanim commented 5 years ago

@arnaudbesnier Yes that id is correct. And yes, we've followed the upgrade note. We have slightly different CORS settings (we currently allow all origins), but we've set allowedHeaders and credentials to the same values as in that note.

killix commented 3 years ago

@arnaudbesnier any update on this issue? We experiment the same issue with some of our relations.

arnaudbesnier commented 3 years ago

Hi @killix, this issue seemed to happen to "all tables" accordin to haneefghanim. I am not sure you observe the same issue (on your relations) even thought the behaviour looks to be the same at first sight.

Can you create a detailed description of your issue in our community forum to have dedicated support on this issue?

killix commented 2 years ago

Sorry for the delay, i will do it this week.