428 Commits

Author SHA1 Message Date
Constantin Graf
411377390d Match existing time entries of members with the same email when deduplicating imports 2026-12-05 12:42:43 +01:00
Constantin Graf
81a0cf8aac Load existing time entries per member and compare the type when deduplicating imports
Existing time entries are now loaded per member and month (backed by the
member_id/start index) and streamed with a cursor, so only the members an
import touches are loaded. The type is part of the fingerprint, so a break is
no longer matched against a work entry.
2026-12-04 16:02:06 +01:00
Constantin Graf
a166f8ef44 Skip time entries that already exist when importing
Re-importing the same data duplicated all time entries, because only
clients, projects, tasks, tags and users were matched with existing
records. Time entries are now matched by member, start, end, project,
task and description. Matches are counted, so identical time entries
within one import are still kept.

Fixes #894
2026-12-04 16:02:06 +01:00
Constantin Graf
bd851e4edf Run the project's pint version in the linting workflow
The laravel-pint-action builds on composer:latest, whose current image lacks
mbstring and crashes pint. Run vendor/bin/pint after setting up PHP instead,
which also uses the pint version from composer.lock. Remove an unused import
that the newer pint version reports.
2026-12-04 15:48:42 +01:00
Constantin Graf
1b6ca3e00f Reject import files that are not UTF-8 encoded
Invalid UTF-8 (for example CSV files saved as Windows-1252 by Excel) was only
rejected by the database on insert, which failed the import with a generic
unexpected error. The CSV importers and the CSV files in solidtime exports are
now checked up front and fail with a clear message.
2026-12-04 15:48:42 +01:00
Constantin Graf
cbc7261a12 Only report unexpected errors of imports 2026-12-04 15:48:42 +01:00
Constantin Graf
eb1e89a91d Mark stale imports and exports as failed before creating new ones and fix review findings
- Mark stale imports/exports of the organization as failed when a new one is created, so they do not block until the prune command runs
- Move the stale check into a stale() scope on the Import and Export models
- Remove orderBy(created_at) from chunkById queries in the prune commands, it skipped rows with random UUIDs
- Delete the export file if the export was deleted while it was running
- Extract the error details formatting into ErrorDetailsFormatter
- Add the exports() relation to Organization
2026-12-04 15:48:42 +01:00
Constantin Graf
b5aa2f7e1a Rename import controller methods to match the export controller 2026-12-04 15:48:42 +01:00
Constantin Graf
89d004f88c Detect project members of another organization in the database consistency check 2026-12-04 15:48:42 +01:00
Constantin Graf
50c028ee23 Reject solidtime imports with project members that reference missing records 2026-12-04 15:48:42 +01:00
Constantin Graf
e44a3733e1 Store error details of failed imports and show them in the admin panel
The importers keep the original exception as the previous exception, so the
exception chain and stack trace can be stored in the new error_details column.
The details are only visible in the admin panel, which now also links the
organization and user of an import.
2026-12-04 15:48:42 +01:00
Constantin Graf
4c8215a889 Store exports in the database and process them in a queued job 2026-12-04 15:48:42 +01:00
Constantin Graf
a440687a41 Mark timed out and stale imports as failed in the prune command
The job's failed() handler can not mark a timed out import as failed, since
the timeout handler runs while the import transaction is still open and the
change is rolled back when the worker is killed. It also must not mark the
import as failed when the queue hands out the job a second time after
retry_after, while the first attempt is still running.

Running imports are now considered stale shortly after the job timeout and
the prune command runs every five minutes.
2026-12-04 15:48:42 +01:00
Constantin Graf
cecaa429c9 Limit the number of records a single import can create 2026-12-04 15:48:42 +01:00
Constantin Graf
a83eeb0222 Store imports in the database and process them in a queued job 2026-12-04 15:48:42 +01:00
Constantin Graf
abb07fdfc8 Look up the member once in time_entries.destroyMultiple 2026-11-19 16:18:11 +01:00
Constantin Graf
34ab2aed32 Normalize email case in admin commands, Filament user form, imports and placeholder merging (#1398)
* Normalize email case in admin commands, Filament user form, imports and placeholder merging

* Add tests for email case normalization

* Lowercase existing invitation emails and match duplicates case-insensitively

Adds a migration that lowercases organization_invitations.email. Invitations of the
same organization whose emails only differ in case are deduplicated first (accepted
invitation preferred, otherwise the newest), so the unique index is not violated.
The duplicate check when inviting a user now ignores case.

* Lowercase placeholder emails in migration and use Str::lower for emails
2026-11-19 14:16:03 +01:00
Constantin Graf
3605a971b4 Fix stale heartbeat lock, skip queue heartbeat on sync driver and enforce a heartbeat timeout 2026-11-19 13:07:06 +01:00
Constantin Graf
9b742372f0 Add heartbeat monitoring for the scheduler and the queue 2026-11-19 13:07:06 +01:00
Constantin Graf
e3b031b426 Require view all permissions for creating and updating reports 2026-11-19 11:47:21 +01:00
Gregor Vostrak
ddcf15bc8f clarify email change locked text 2026-11-18 16:31:48 +01:00
Constantin Graf
7912b0a237 Add exit impersonation to the user menu 2026-11-18 16:31:48 +01:00
Constantin Graf
cc23cdc76b Fix bcrypt cost at 12 so the absent-user hash matches login timing 2026-11-18 16:31:48 +01:00
Gregor Vostrak
f845c9001b Add core support for extendable authentication and passwordless user
creation
2026-11-18 16:31:48 +01:00
Constantin Graf
7a570dc567 Recalculate project and task spent time after admin time entry changes
Creating, editing, deleting and bulk deleting time entries in the Filament
admin panel did not dispatch the spent time recalculation jobs, leaving
stale spent_time values on projects and tasks.

Fixes #1319
2026-11-11 18:26:57 +01:00
Constantin Graf
e4d337f42e Look up the e2e test member from the user's own memberships and order memberships by age 2026-11-09 14:17:12 +01:00
Constantin Graf
97bd942b9a Check organization membership in middleware and cache permission lookups 2026-11-09 12:41:22 +01:00
Constantin Graf
369b012cc0 Validate import emails with the app's RFC rule
Use email:rfc,strict instead of FILTER_VALIDATE_EMAIL so every address the
app accepts (including Unicode ones) can be re-imported, and add the rule to
the user import helper so generated Harvest emails are validated too. Stop
trimming emails so they match existing users exactly as stored, and fix the
misplaced docblocks.
2026-11-09 12:07:09 +01:00
Constantin Graf
063ce93fb7 Validate user emails in imports 2026-11-09 12:07:09 +01:00
Constantin Graf
15af6125b2 Dispatch Verified event after the transaction commits in UserService::createUser 2026-11-09 11:45:24 +01:00
Constantin Graf
9996f7bc2b Fire verified event for users created with a verified email 2026-11-09 11:45:24 +01:00
Constantin Graf
9bc26bf181 Skip task-belongs-to-project rule when no organization is bound 2026-11-09 11:44:40 +01:00
Constantin Graf
48ca588b7d Keep task-belongs-to-project check for missing project_id and share it via helper
- Fix required_with key for changes.project_id in bulk time entry update
- Run task check when project_id is null, skip only for non-UUID values
- Move the duplicated task rule into BaseFormRequest::taskBelongsToProjectRule
2026-11-09 11:44:40 +01:00
Constantin Graf
60f91b8ea0 Skip project-dependent task rules when project_id is not a valid UUID 2026-11-09 11:44:40 +01:00
Constantin Graf
6debd4cb1e Add foreign key from oauth refresh tokens to access tokens and delete orphaned refresh tokens 2026-11-07 21:54:02 +01:00
Constantin Graf
dc1199962a Respect daylight saving time when grouping time entries by date
The date grouping in the time entry aggregation and the dashboard shifted
all entries by the current UTC offset of the user's timezone. Entries
tracked in the other DST period were assigned to the wrong day, week,
month or year, and with fill_gaps_in_time_groups entries at the edge of
the range were dropped ("Problem with filling gaps in time groups").

The conversion to local time is now done per row by PostgreSQL
(AT TIME ZONE) with the timezone passed as a binding.
2026-11-05 13:32:51 +01:00
Constantin Graf
2b371c4aed Disable unused Passport device grant 2026-11-05 13:11:48 +01:00
Constantin Graf
0e1ed2e114 Keep the client of time entries in sync with their project 2026-11-03 17:29:40 +01:00
Constantin Graf
cc9d04ab5a Keep registration working when an accepted invitation can not be turned into a membership 2026-11-03 17:09:24 +01:00
AKolenda
b561179ba5 Redirect logged-out users to login from the OAuth authorization page
Passport's /oauth/authorize prompts guests to log in by throwing an
AuthenticationException without a redirect target. Laravel 13 renders
such an exception as an empty 401 instead of falling back to the login
route, so OAuth clients opened in a browser without a solidtime session
showed a blank "HTTP ERROR 401" page.

Register the login route as the fallback redirect for authentication
exceptions, which restores the redirect to /login and the return to the
authorization prompt after logging in.
2026-11-03 16:21:35 +01:00
Constantin Graf
f7c8e03bfa Render Markdown in user-provided mail values as plain text 2026-11-02 15:01:22 +01:00
Constantin Graf
c87e19d339 Fix TypeError when filling gaps for non-time groups without subgroup 2026-11-02 11:38:12 +01:00
Constantin Graf
264ae3030c Fix missing months in yearly admin charts at the end of a month 2026-10-30 17:47:36 +01:00
Constantin Graf
902270a189 Only check billable rate restriction if time entry becomes billable 2026-10-14 15:15:24 +02:00
Constantin Graf
1c41432389 Enforce billable rate restriction in controllers and importers instead of model hooks 2026-10-14 15:15:24 +02:00
Gregor Vostrak
ba2b37f264 add billable rate restriction for free organizations 2026-10-14 15:15:24 +02:00
Gregor Vostrak
11dd4e174e add time entry filter normalizeation 2026-10-14 14:11:16 +02:00
Constantin Graf
b73cdc4bb5 Detect time entries with a task but no project in consistency check
The comparison used != which evaluates to NULL when the time entry has no
project, so entries that kept their task after the project was removed
were not reported.
2026-10-14 13:20:21 +02:00
Gregor Vostrak
e82c601449 Remove task from time entry when project changes without a new task
PUT /time-entries/{id} accepted a new project_id while keeping a task from
the previous project, leaving the entry with a task that belongs to a
different project. The bulk endpoint already handled a project switch but
kept the task when the project was removed.

Both endpoints now remove the task whenever project_id is changed without
task_id and the current task does not belong to the new project.
2026-10-14 13:20:21 +02:00
Constantin Graf
f65a1532ad Delete running time entries of placeholder when merging members
The running time entries of the merged member could give the destination
member a second running time entry. The placeholder is deleted after the
merge, so its running time entries can not stay with it.
2026-10-14 11:11:53 +02:00