|
|
ChatGPT 1/12/2026 |
|
Using PHPRunner with a centralized database for multi-tenant applications can be a bit tricky, especially when it comes to features like the Notifications API. The core issue you're facing seems to revolve around permissions and the correct handling of notifications across different tenants in your application. Here are some steps and suggestions that may help you troubleshoot and potentially resolve the issue:
By following these steps, you should be able to diagnose the issue further and determine a viable solution for implementing the Notifications API in your multi-tenant application. If you have specific error messages or behavior you're observing, feel free to share, and I can provide more tailored advice. |
|
|
|
Sergey Kornilov admin 1/14/2026 |
|
Unfortunately I have no idea what "class code for permissions in classes / notifications file" is. Since this is a SaaS kind of project you need to make sure that notofication tables are located individual tenant databases. |
|
|
|
lefty author 1/16/2026 |
|
So Yes it is the classes/notifications.php in the source code. I get infinite loading error because , the notification data is not present in the teanant _noti table and is writing to the wrong table. Unless you have to explicitly select it with a database connection which defeats the purpose of the dbname and SaaS setup as documented. // Target salesman login (resolved via dependent dropdown) // Build notification message // Optional expiry // Send notification |
|
|
|
lefty author 1/18/2026 |
|
Update: This is what I found in multiple tests and why this will never work without an updated class for classes/notifications.php and possilbe some othe rendering page also. Ex. Bootstrap UI In my setup: This is a true SaaS deployment with one central users database and separate physical databases per tenant authentication security user settings (column widths, layouts, etc.) stored in the users database When the Notification API is enabled: Notifications with all parameters null Notifications sent to the same logged-in user Notifications sent to another user Notifications with no unread records In all cases, the moment addNotification() is called: The page enters an infinite loading loop Logout also breaks The notification bell never renders Placing _noti tables in each tenant database does not help, because: From testing, it appears that the Notification API cannot be invoked at all in a DB-per-tenant SaaS setup without causing a bootstrap recursion. I believe this is not a usage error, but an architectural limitation of the current Notification API design. But since it is writing to the users _notification table correctly , this is the line of why it won't render ans is still permission related public function __construct( $params ) { * $this->dataSource = getDbTableDataSource( $this->table["table"], $this->table["connId"] );*in th class/notifications.php source code. Therefore the only way to fix is |
|