Description
We had a development environment with a hosted database, and we noticed how we somehow ploughed throught 1.5gb of egress per day per single developer only for this Cord instance.
Mind you, this database has not much data at all, mostly short testing messages:
- 2 users
- 13 threads
- 77 messages
- 24 thread participants
Seems like a single call to notification.useData
from the frontend results in ~100 queries (30 queries of threads, even though the number of total threads is less) to the database, only to return 10 notifications back. On every single page load.
Now, I wonder if anyone else has witnessed this, or have we misconfigured something and missing some caching or anything else?
A single page load with an empty cord context (completely empty page, no re-renderings or anything), results in 7 queries of the below to the database:
SELECT
"id",
"name",
"sharedSecret",
"createdTimestamp",
"customEmailTemplate",
"enableEmailNotifications",
"customLinks",
"customS3Bucket",
"segmentWriteKey",
"customNUX",
"iconURL",
"type",
"environment",
"supportOrgID",
"supportBotID",
"supportSlackChannelID",
"redirectURI",
"customerID",
"slackConnectAllOrgs",
"eventWebhookURL",
"eventWebhookSubscriptions",
"customSlackAppID",
"customSlackAppDetails"
FROM
"cord"."applications" AS "ApplicationEntity"
WHERE
"ApplicationEntity"."id" = 'REDACTED'