-
Notifications
You must be signed in to change notification settings - Fork 34
Description
- Laravel Version: 10.32.1
- Nova Version: 4.31.3
- PHP Version: 8.2.3
- Database Driver & Version: MySQL 8.0.28
- Operating System and Version: #.#
- Browser type and version: Chrome Version 119.0.6045.159 (Official Build) (arm64)
- Reproduction Repository: https://github.com/###/###
Description:
I've noticed when displaying large numbers as Text that the numbers are being altered somewhere in the frontend Javascript leading to incorrect values being displayed. Searching a resource by this number and updating the value for this number via a form are saved correctly, it seems to only be a display issue.
Detailed steps to reproduce the issue on a fresh Nova installation:
- Create a table with the following structure:
CREATE TABLE `channel_subscriptions` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`platform_thread_id` bigint unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
- Create a nova resource for this table with the field:
Text::make('Platform Thread Id','platform_thread_id'),
- Add a record to the table with
platform_thread_idset to value1120706941212172299.
Showing the resource on Nova displays the number as 1120706941212172300 which is incorrect. I handle this as a Text field in Nova expecting that it would avoid any Javascript rounding issues. This incorrect number also shows when editing the resource from a relation (as shown below). Re-entering the correct value and saving this form saves the correct value.
As well as when showing the resource via an index page (again using it as a Text field):
I can also see in the ajax requesting loading the data that it's actually loading the correct value, so the value appears to be altered somewhere in the frontend JS before it's displayed:
screenshot taken from ajax request
/nova-api/channel-subscriptions?search=Channel&filters=W3siQXBwXFxOb3ZhXFxGaWx0ZXJzXFxDaGFubmVsU3Vic2NyaXB0aW9uc1xcQnlDYXRlZ29yeSI6IiJ9LHsiQXBwXFxOb3ZhXFxGaWx0ZXJzXFxDaGFubmVsU3Vic2NyaXB0aW9uc1xcQnlDaGFubmVsVHlwZSI6IiJ9XQ%3D%3D&orderBy=&perPage=15&trashed=&page=1&viaResource=server&viaResourceId=875707&viaRelationship=channelSubscriptions&relationshipType=hasMany