1924 Commits

Author SHA1 Message Date
Duansg 2c0ced322d fix: use TagStatusDeleted instead of QuestionStatusDeleted in tag permission
Lint / Lint (ubuntu-latest) (push) Has been cancelled
2026-08-17 12:23:24 +08:00
LinkinStars 1ccb4b7adc fix: add ASF header to tag search test
Signed-off-by: LinkinStars <linkinstar@foxmail.com>
2026-08-11 19:50:54 +08:00
Max Engine 4488ccc689 fix: tag search never matches on slug name
The search term was formatted into LOWER(%s) and passed as the *value* of the
LIKE, so the function name ended up inside the pattern:

    slug_name LIKE '%LOWER(coco)%'

That can never match. Only the display_name clause did any work, and LIKE is
case-sensitive on Postgres, so searching a tag by the name it is written in
returns nothing:

    slug_name=Coco  -> matches
    slug_name=coco  -> no match

Tags are lower case by convention, so lower case is what users type, and the
filter appears to report that no such tag exists.

Lower both sides instead. The term normalisation is extracted so it can be
covered by a test without a database.
2026-08-11 19:31:39 +08:00
ferhat elmas 98329f3b05 fix: advanced site settings setup from migration 30
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
2026-07-29 19:09:48 +08:00
Luffy 3b9f137061 fix: edit question fails when short links enabled (#1554)
CI / Check and lint (push) Has been cancelled
Build Latest Docker Image For Release / build (push) Has been cancelled
Lint / Lint (ubuntu-latest) (push) Has been cancelled
Build Binary For Release / build-goreleaser (push) Has been cancelled
Build Docker Image For Release / build (push) Has been cancelled
Close #1553
2026-07-17 22:38:41 +08:00
LinkinStars 9d9f5d06a8 fix: enhance user admin service to manage API keys and filter answer visibility 2026-07-10 10:19:39 +08:00
LinkinStars c589b59dd5 fix: enhance answer visibility checks for user permissions 2026-07-10 10:19:39 +08:00
LinkinStars 0705ea6bae fix(tests): add mock methods for cache OAuth state in new question notification tests 2026-07-10 10:19:39 +08:00
LinkinStars 88c288fdda fix(tests): update goroutine handling in new question email worker tests 2026-07-10 10:19:39 +08:00
LinkinStars f5e25dcb8d fix(notification): remove buffer size parameter from new question email worker for test 2026-07-10 10:19:39 +08:00
Artur Iusupov e06311a514 fix(notification): make new question email queue configurable 2026-07-10 10:19:39 +08:00
Artur Iusupov cb97394211 fix(notification): move new question email throttling to worker 2026-07-10 10:19:39 +08:00
Artur Iusupov dda51232b9 feat(notification): add interval for new question emails 2026-07-10 10:19:39 +08:00
LinkinStars a00cb2d38c fix: update goroutine handling and context imports for consistency 2026-07-10 10:19:39 +08:00
LinkinStars f92a0fe140 Harden Accept-Language parsing 2026-07-10 10:19:39 +08:00
LinkinStars b575fe893b Harden avatar cleanup ownership checks 2026-07-10 10:19:39 +08:00
LinkinStars 54b1b35df5 Align revision audit permission checks 2026-07-10 10:19:39 +08:00
LinkinStars 06a0f742f2 fix external login account binding 2026-07-10 10:19:39 +08:00
Artur Iusupov 3a5a15fe77 fix(site): require explicit email verification setting
Replace OptionalBool with an explicit require_email_verification value for the login settings save request while keeping legacy read defaults intact.

Use positive RequireEmailVerification naming through the registration flow and inline the site setting mapping.

Add validation, save-path, and registration coverage for the explicit email verification setting.
2026-07-10 10:19:39 +08:00
Artur Iusupov 7123326515 feat(site): allow disabling email verification 2026-07-10 10:19:39 +08:00
hgaol 4aa52a6b52 fix: accept answer fails when short links enabled (#1541)
The ownership check added to AcceptAnswer compared the answer's QuestionID
against the request's QuestionID directly. When short links are enabled,
answerRepo.GetByID re-encodes QuestionID to its short form while the
controller de-shorts req.QuestionID to its long form, so the two encodings
of the same question never matched and every accept returned "Answer do not
found". Normalize both ids via uid.DeShortID before comparing, preserving the
privilege-escalation guard for answers that truly belong to another question.
2026-07-10 10:19:39 +08:00
hhc7 9234d80246 fix: scope JSON 500 to API routes, skip rewriting already-flushed responses 2026-07-10 10:19:39 +08:00
hhc7 10be96814e feat: add recovery middleware to handle panic gracefully 2026-07-10 10:19:39 +08:00
Luke Gao 09eaa5b7e3 feat: add reasoning content to AI conversation records and update related components (#1530)
Fix #1524 

Root cause

DeepSeek's reasoning models stream reasoning_content alongside content.
Answer ignored it, so follow-up requests failed with 400: The
reasoning_content in the thinking mode must be passed back to the API,
and the thinking text was never shown or saved.

Fix

- Capture reasoning_content from the stream and pass it back to theAPI
on subsequent rounds.
 - Persist it with the conversation (new DB column via migrationv2.0.2).
- Render it in the chat UI as a collapsible "Thinking…/Thoughts"panel
above the answer.

Compatibility

Nullable column, omitempty field, UI hides the panel when empty — old
conversations and non-reasoning models behave exactly as before.

Demo



https://github.com/user-attachments/assets/49b1a2a1-9133-4ac2-bbeb-860215a50285
2026-07-10 10:19:39 +08:00
LinkinStars b1da65fbe4 Merge remote-tracking branch 'origin/fix/2.0.1/chat' into test 2026-05-11 12:16:58 +08:00
LinkinStars 11091244f6 fix(user): enhance avatar validation by adding checks for custom avatars and file ownership 2026-05-11 12:05:18 +08:00
LinkinStars d1a4092c61 fix(email): enhance email templates by escaping HTML characters in dynamic content 2026-05-09 16:07:09 +08:00
LinkinStars 11c80384f1 fix(chat): enhance visibility checks by adding admin moderator support in answer and comment services 2026-05-09 15:13:50 +08:00
LinkinStars 97924574c4 Merge remote-tracking branch 'origin/dev' into test 2026-05-08 19:58:22 +08:00
hgaol e3831b6f52 refactor: streamline plugin initialization by removing redundant search syncer registration 2026-05-08 19:57:19 +08:00
hgaol c93f3bc5c3 refactor: simplify SaveSiteAI method by removing unnecessary error handling 2026-05-08 19:57:19 +08:00
hgaol 278fdfd8c3 refactor: rename UpdateSearch to updateSearch for consistency 2026-05-08 19:57:19 +08:00
hgaol 2836d0ea81 chore: add Apache License header to multiple files 2026-05-08 19:57:19 +08:00
hgaol ac7bdda074 fix lint 2026-05-08 19:57:19 +08:00
hgaol 5d923f8ca3 feat: add vector sync service and integrate with answer and question services 2026-05-08 19:57:19 +08:00
hgaol 22c2a5c276 feat: implement vector search plugin and syncer for question/answer embeddings
- Added a new vector search syncer to aggregate questions and answers with comments for vector embedding.
- Introduced a new VectorSearch interface and related structures for managing vector storage and similarity search.
- Refactored embedding service to delegate semantic search to the new vector search plugin.
- Removed embedding-related fields from SiteAIProvider and UI forms as part of the transition to the new vector search architecture.
- Updated plugin registration to include vector search capabilities.
- Cleaned up embedding service methods and removed unused dependencies.
2026-05-08 19:57:19 +08:00
hgaol f346bcc8fa update init tables 2026-05-08 19:57:19 +08:00
hgaol dea18f997c feat: support semantic search in AI chat and embedding ability 2026-05-08 19:57:19 +08:00
hgaol 71d11b6205 fix: resolve local plugin paths to absolute and enhance module replacement logic 2026-04-15 19:43:57 +08:00
LinkinStars 9da00a807d fix(build): enhance module replacement handling for v2+ versions and implement local cloning 2026-04-15 16:15:13 +08:00
LinkinStars 2dbe594da2 fix(short_id): enhance GetEnableShortID to support gin context for short ID flag retrieval 2026-03-04 12:04:52 +08:00
LinkinStars 36b548140e Merge remote-tracking branch 'origin/dev' into test 2026-03-03 12:17:41 +08:00
LinkinStars 3c5c47b91b Merge remote-tracking branch 'origin/fix/2.0.1/chat' into test 2026-03-03 12:17:36 +08:00
LinkinStars 6fc25c69f4 fix(auth): add API key scope checks to enhance authorization security 2026-03-03 12:17:20 +08:00
maishivamhoo123 ff997cb014 fix: update migration version to v2.0.1 and remove default value for TEXT column 2026-03-02 17:37:43 +08:00
maishivamhoo123 09599e4c20 style: apply gofmt formatting 2026-03-02 17:37:43 +08:00
maishivamhoo123 844c73cd7f fix: change avatar column type to TEXT to support long URLs 2026-03-02 17:37:43 +08:00
LinkinStars 659d1f6ad9 Merge remote-tracking branch 'origin/fix/2.0.1/chat' into test 2026-02-09 23:36:02 +08:00
LinkinStars 7952075ce5 fix: normalize ObjectID and CommentID in comment requests 2026-02-09 23:35:17 +08:00
LinkinStars 52d057ef18 fix: add ID validation and normalization functions for comment handling 2026-02-09 20:27:37 +08:00