Fix Model layer & API robustness batch (7 items)
- Entity::update() now checks rowCount; returns false when no rows affected.
- Entity::update() preserves modified_fields on PDOException (try/catch).
- Device::set_device_token() caches auth() call instead of 3 repeated invocations.
- User::__construct() removed eager profile query; profile() now lazy-loads via get_pet_instance().
- alias_is_uniq() in Areas and Devices models accepts optional exclude_id to skip self on update.
- Controllers updated to pass entity id to alias_is_uniq() so updating alias to current value succeeds.
- CronController::run_regular_cron_scripts() wraps each script in try/catch; logs failure and continues.
- App::api_auth_guard() replaced exit() with return false; EventsHandlers stops routing on auth rejection.
- Tests added: EntityCrud (missing-record + preserved-fields), UserEntity (lazy-loading),
  CronController (failure-continuation), AppAuthGuard (structured 401 output),
  Areas/Devices validation (same-alias update allowed).
- Test bootstrap: added logs_enable/logs_folder to FCONF to suppress PHP warnings in Cron tests.

All 136 server tests pass, 334 assertions.
All 167 Vue client tests pass.
1 parent 8ac5109 commit 8a945d0dd4fb2ef9546e91e8155f470dd90e072a
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 2 days ago
Showing 17 changed files
View
server/SHServ/App.php
View
server/SHServ/Controllers/AreasRESTAPIController.php
View
server/SHServ/Controllers/CronController.php
View
server/SHServ/Controllers/DevicesRESTAPIController.php
View
server/SHServ/Entities/Device.php
View
server/SHServ/Entities/User.php
View
server/SHServ/EventsHandlers.php
View
server/SHServ/Middleware/Entity.php
View
server/SHServ/Models/Areas.php
View
server/SHServ/Models/Devices.php
View
server/tests/AppAuthGuardTest.php
View
server/tests/AreasRESTAPIControllerValidationTest.php
View
server/tests/CronControllerTest.php 0 → 100644
View
server/tests/DevicesRESTAPIControllerValidationTest.php
View
server/tests/EntityCrudTest.php
View
server/tests/UserEntityTest.php 0 → 100644
View
server/tests/bootstrap.php