Commit Graph

367 Commits (d326c710789197b225a065c79468e6c4470afbd0)

Author SHA1 Message Date
Johnny d326c71078 refactor(db): rename tables for clarity - resource→attachment, system_setting→instance_setting 5 months ago
Johnny bd02de9895
chore: add store tests (#5397) 6 months ago
Johnny 78aa41336a feat: implement attachment filtering functionality 6 months ago
Johnny 7932f6d0d0
refactor: user auth improvements (#5360) 6 months ago
Johnny 310590b278 chore: fix golang checks 6 months ago
Johnny 40e129b8af refactor(auth): streamline session authentication and cookie handling 6 months ago
Steven 0610257562 refactor(store): remove deprecated migration_history table and backward compatibility code
Complete removal of migration_history system in favor of instance_setting based schema versioning.

Changes:
- Remove migration_history table creation from all LATEST.sql files
- Delete all migration_history model and implementation files (~300 lines)
- Remove FindMigrationHistoryList and UpsertMigrationHistory from Driver interface
- Replace complex backward compatibility functions with simple version check
- Update health check to use instance_setting instead of migration_history
- Simplify checkMinimumUpgradeVersion to detect pre-v0.22 installations

Breaking change:
Users on versions < v0.22.0 (May 2024) must upgrade to v0.25.x first before upgrading to this version.
Clear error message with upgrade instructions will be shown for old installations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
7 months ago
Steven d1492007ab fix(store): filter inbox notifications by message type at database level
Add MessageType filter to FindInbox to exclude legacy VERSION_UPDATE
notifications from inbox queries. This resolves the issue where users
saw notification counts but no items displayed, as VERSION_UPDATE
entries cannot be rendered in the new UserNotification API.

Changes:
- Add MessageType field to FindInbox struct for database-level filtering
- Implement JSON extraction filters in SQLite, MySQL, and PostgreSQL drivers
- Update ListUserNotifications to filter MEMO_COMMENT type at store level

This approach improves performance by filtering at the database rather
than in application code, reducing unnecessary data transfer for users
with many legacy inbox entries.

Fixes #5278

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
7 months ago
Steven 07a030ddfd fix(postgres): update tag filtering SQL to ensure proper type casting for LIKE comparisons 7 months ago
Steven 424f11f227 fix(store): fix PostgreSQL tag filtering type inference error
Resolves issue where tag filtering in PostgreSQL databases failed with "operator does not exist: jsonb ~~ unknown" error. The hierarchical tag filtering feature introduced in commit 5e47f25b generated SQL with implicit type placeholders that PostgreSQL couldn't infer.

The fix explicitly casts the LIKE comparison placeholder to text (::text) in the PostgreSQL dialect, ensuring proper type resolution for the query parameter.

Fixes #5275

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
7 months ago
boojack 21d31e3609
fix(security): implement security review recommendations (#5228)
Co-authored-by: Claude <noreply@anthropic.com>
7 months ago
Steven 4c1d1c70d1 refactor: rename workspace to instance throughout codebase
Remove work-related terminology by renaming "workspace" to "instance"
across the entire application. This change better reflects that Memos
is a self-hosted tool suitable for personal and non-work use cases.

Breaking Changes:
- API endpoints: /api/v1/workspace/* → /api/v1/instance/*
- gRPC service: WorkspaceService → InstanceService
- Proto types: WorkspaceSetting → InstanceSetting
- Frontend translation keys: workspace-section → instance-section

Backend Changes:
- Renamed proto definitions and regenerated code
- Updated all store layer methods and database drivers
- Renamed service implementations and API handlers
- Updated cache from workspaceSettingCache to instanceSettingCache

Frontend Changes:
- Renamed service client: workspaceServiceClient → instanceServiceClient
- Updated all React components and state management
- Refactored stores: workspace.ts → instance.ts
- Updated all 32 locale translation files

All tests pass and both backend and frontend build successfully.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
7 months ago
Steven 5e47f25bf5 feat(store): add hierarchical tag filtering support
Tag filters now support hierarchical matching where searching for a tag (e.g., "book") will match both the exact tag and any tags with that prefix (e.g., "book/fiction", "book/non-fiction"). This applies across all database backends (SQLite, MySQL, PostgreSQL) with corresponding test updates.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
8 months ago
Steven e0b1153269 fix(web): resolve MobX observable reactivity issue in filter computation
Fixes filtering functionality that was broken due to improper use of
useMemo with MobX observables. The issue occurred because useMemo's
dependency array uses reference equality, but MobX observable arrays
are mutated in place (reference doesn't change when items are added/removed).

Changes:
- Remove useMemo from filter computation in Home, UserProfile, and Archived pages
- Calculate filters directly in render since components are already MobX observers
- Fix typo: memoFitler -> memoFilter in Archived.tsx

This ensures filters are recalculated whenever memoFilterStore.filters changes,
making tag clicks and other filter interactions work correctly.

Fixes #5189

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
8 months ago
Steven 46ce0bc62e fix(store): correct PostgreSQL placeholder generation in IN clauses
Fixes a regression introduced in v0.25.2 where PostgreSQL IN clause
placeholders were not properly incremented, causing all parameters to
use the same placeholder index (e.g., $1, $1, $1 instead of $1, $2, $3).

This bug affected:
- ListReactions (ContentIDList) - caused "failed to list reactions" errors
- ListAttachments (MemoIDList)
- ListMemos (IDList and UIDList)

The fix combines placeholder generation and argument appending into a
single loop to ensure proper incrementing.

Fixes #5188

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
8 months ago
Claude e35f16306e feat: add id as final tie-breaker in ListMemos 8 months ago
Steven b4ea7d843f feat: enhance memo sorting functionality to support multiple fields 8 months ago
Steven 95de5cc700 refactor: update migration history methods 8 months ago
Copilot b685ffacdf refactor: memo filter
- Updated memo and reaction filtering logic to use a unified engine for compiling filter expressions into SQL statements.
- Removed redundant filter parsing and conversion code from ListMemoRelations, ListReactions, and ListAttachments methods.
- Introduced IDList and UIDList fields in FindMemo and FindReaction structs to support filtering by multiple IDs.
- Removed old filter test files for reactions and attachments, as the filtering logic has been centralized.
- Updated tests for memo filtering to reflect the new SQL statement compilation approach.
- Ensured that unsupported user filters return an error in ListUsers method.
8 months ago
Steven c3d4f8e9d1 feat: implement user-specific SQL converter for filtering in user service 9 months ago
varsnotwars 4eb5b67baf
feat: attachments by id (#5008) 10 months ago
varsnotwars f4bdfa28a0
feat: filter/method for reactions by content_id (#4969) 10 months ago
Colin Holzman 8319516d1a
fix: boolean filters (#4966) 10 months ago
johnnyjoy 506b477d50 fix: get user by username 11 months ago
varsnotwars fa2fa8a5d7
refactor: remove call to db for parent memo name (#4947) 11 months ago
Colin Holzman aae7ec8d1f
fix: calendar filter (#4942) 11 months ago
Maximilian Krauß 4d6042e35f
fix(tags): ensure JSON array elements are properly formatted in SQL queries (#4944) 11 months ago
johnnyjoy ed23cbc011 refactor: memo filter 11 months ago
Steven 1a75d19a89 fix: memo filter for sqlite 11 months ago
johnnyjoy 7098721617 chore: fix linter 11 months ago
johnnyjoy e24f92b719 fix: tests 11 months ago
johnnyjoy b55904a428 feat: support more filter factors 11 months ago
johnnyjoy 6d9770b9c8 chore: move filter to filters 11 months ago
johnnyjoy 7481fe10bf chore: remove order by pinned 11 months ago
Johnny 40130350c5 fix: args offset for postgres 11 months ago
johnnyjoy d6a75bba4c refactor: webhook service 12 months ago
Johnny e6e460493c refactor: general user setting 12 months ago
Johnny 9b15936873 refactor: clean unused fields 12 months ago
Johnny 778a5eb184 refactor: memo filter 12 months ago
Steven a4920d464b refactor: attachment service part2 1 year ago
Johnny 38b6c3afb9 chore: fix linter 1 year ago
Johnny 3fd29f6493 refactor: schema migrator 1 year ago
Steven f1b365f928 refactor: clean packages 1 year ago
Steven de3e55c2e6 feat: support `now()` time functions 1 year ago
Steven b89d8f5342 feat: implement hasTaskList filter 1 year ago
johnnyjoy f9e07a2245 feat: support update user's role 1 year ago
Steven 1f79ee575b fix: create user with avatar url for sqlite 1 year ago
johnnyjoy 2a92baf52c fix: filter args of postgres 1 year ago
Johnny b94682dc4f
chore: fix linter 1 year ago
Johnny 18b9b9d18f
chore: implement memo filter in list memo relations 1 year ago