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.
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
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.
- 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
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.
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.
* 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
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
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.
- 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
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.
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.
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.
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.
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.