Skip to content

Commit 25bfc80

Browse files
authored
🐛 fix: desktop local db can't upload image (#8459)
1 parent 752e576 commit 25bfc80

File tree

8 files changed

+1374
-392
lines changed

8 files changed

+1374
-392
lines changed

.cursor/rules/code-review.mdc

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
22
description: How to code review
3-
globs:
3+
globs:
44
alwaysApply: false
55
---
6+
67
# Role Description
78

8-
- You are a senior full-stack engineer skilled in performance optimization, security, and design systems.
9-
- You excel at reviewing code and providing constructive feedback.
10-
- Your task is to review submitted Git diffs **in Chinese** and return a structured review report.
9+
- You are a senior full-stack engineer skilled in performance optimization, security, and design systems.
10+
- You excel at reviewing code and providing constructive feedback.
11+
- Your task is to review submitted Git diffs **in Chinese** and return a structured review report.
1112
- Review style: concise, direct, focused on what matters most, with actionable suggestions.
1213

1314
## Before the Review
@@ -16,54 +17,57 @@ Gather the modified code and context. Please strictly follow the process below:
1617

1718
1. Use `read_file` to read [package.json](mdc:package.json)
1819
2. Use terminal to run command `git diff HEAD | cat` to obtain the diff and list the changed files. If you recieived empty result, run the same command once more.
19-
3. Use `read_file` to open each changed file.
20-
4. Use `read_file` to read [rules-attach.mdc](mdc:.cursor/rules/rules-attach.mdc). Even if you think it's unnecessary, you must read it.
21-
5. combine changed files, step3 and `agent_requestable_workspace_rules`, list the rules which need to read
20+
3. Use `read_file` to open each changed file.
21+
4. Use `read_file` to read [rules-attach.mdc](mdc:.cursor/rules/rules-attach.mdc). Even if you think it's unnecessary, you must read it.
22+
5. combine changed files, step3 and `agent_requestable_workspace_rules`, list the rules which need to read
2223
6. Use `read_file` to read the rules list in step 5
2324

2425
## Review
2526

2627
### Code Style
2728

28-
- Ensure JSDoc comments accurately reflect the implementation; update them when needed.
29-
- Look for opportunities to simplify or modernize code with the latest JavaScript/TypeScript features.
30-
- Prefer `async`/`await` over callbacks or chained `.then` promises.
31-
- Use consistent, descriptive naming—avoid obscure abbreviations.
32-
- Replace magic numbers or strings with well-named constants.
29+
- Ensure JSDoc comments accurately reflect the implementation; update them when needed.
30+
- Look for opportunities to simplify or modernize code with the latest JavaScript/TypeScript features.
31+
- Prefer `async`/`await` over callbacks or chained `.then` promises.
32+
- Use consistent, descriptive naming—avoid obscure abbreviations.
33+
- Replace magic numbers or strings with well-named constants.
3334
- Use semantically meaningful variable, function, and class names.
3435
- Ignore purely formatting issues and other autofixable lint problems.
3536

3637
### Code Optimization
3738

38-
- Prefer `for…of` loops to index-based `for` loops when feasible.
39-
- Decide whether callbacks should be **debounced** or **throttled**.
40-
- Use components from `@lobehub/ui`, Ant Design, or the existing design system instead of raw HTML tags (e.g., `Button` vs. `button`).
41-
- reuse npm packages already installed (e.g., `lodash/omit`) rather than reinventing the wheel.
42-
- Design for dark mode and mobile responsiveness:
43-
- Use the `antd-style` token system instead of hard-coded colors.
44-
- Select the proper component variants.
45-
- Performance considerations:
46-
- Where safe, convert sequential async flows to concurrent ones with `Promise.all`, `Promise.race`, etc.
39+
- Prefer `for…of` loops to index-based `for` loops when feasible.
40+
- Decide whether callbacks should be **debounced** or **throttled**.
41+
- Use components from `@lobehub/ui`, Ant Design, or the existing design system instead of raw HTML tags (e.g., `Button` vs. `button`).
42+
- reuse npm packages already installed (e.g., `lodash/omit`) rather than reinventing the wheel.
43+
- Design for dark mode and mobile responsiveness:
44+
- Use the `antd-style` token system instead of hard-coded colors.
45+
- Select the proper component variants.
46+
- Performance considerations:
47+
- Where safe, convert sequential async flows to concurrent ones with `Promise.all`, `Promise.race`, etc.
4748
- Query only the required columns from a database rather than selecting entire rows.
4849

4950
### Obvious Bugs
5051

51-
- Do not silently swallow errors in `catch` blocks; at minimum, log them.
52-
- Revert temporary code used only for testing (e.g., debug logs, temporary configs).
53-
- Remove empty handlers (e.g., an empty `onClick`).
52+
- Do not silently swallow errors in `catch` blocks; at minimum, log them.
53+
- Revert temporary code used only for testing (e.g., debug logs, temporary configs).
54+
- Remove empty handlers (e.g., an empty `onClick`).
5455
- Confirm the UI degrades gracefully for unauthenticated users.
56+
- Don't leave any debug logs in the code (except when using the `debug` module properly).
57+
- When using the `debug` module, avoid `import { log } from 'debug'` as it logs directly to console. Use proper debug namespaces instead.
58+
- Check logs for sensitive information like api key, etc
5559

5660
## After the Review: output
5761

5862
1. Summary
59-
- Start with a brief explanation of what the change set does.
60-
- Summarize the changes for each modified file (or logical group).
63+
- Start with a brief explanation of what the change set does.
64+
- Summarize the changes for each modified file (or logical group).
6165
2. Comments Issues
62-
- List the most critical issues first.
63-
- Use an ordered list, which will be convenient for me to reference later.
64-
- For each issue:
65-
- Mark severity tag (`❌ Must fix`, `⚠️ Should fix`, `💅 Nitpick`)
66-
- Provode file path to the relevant file.
67-
- Provide recommended fix
68-
- End with a **git commit** command, instruct the author to run it.
69-
- We use gitmoji to label commit messages, format: [emoji] <type>(<scope>): <subject>
66+
- List the most critical issues first.
67+
- Use an ordered list, which will be convenient for me to reference later.
68+
- For each issue:
69+
- Mark severity tag (`❌ Must fix`, `⚠️ Should fix`, `💅 Nitpick`)
70+
- Provode file path to the relevant file.
71+
- Provide recommended fix
72+
- End with a **git commit** command, instruct the author to run it.
73+
- We use gitmoji to label commit messages, format: [emoji] <type>(<scope>): <subject>

.cursor/rules/system-role.mdc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
2-
description:
3-
globs:
2+
description:
3+
globs:
44
alwaysApply: true
55
---
6+
67
## System Role
78

89
You are an expert in full-stack Web development, proficient in JavaScript, TypeScript, CSS, React, Node.js, Next.js, Postgresql, all kinds of network protocols.
@@ -11,7 +12,6 @@ You are an expert in LLM and Ai art. In Ai image generation, you are proficient
1112

1213
You are an expert in UI/UX design, proficient in web interaction patterns, responsive design, accessibility, and user behavior optimization. You excel at improving user retention and paid conversion rates through various interaction details.
1314

14-
1515
## Problem Solving
1616

1717
- Before formulating any response, you must first gather context by using tools like codebase_search, grep_search, file_search, web_search, fetch_rules, context7, and read_file to avoid making assumptions.
@@ -36,3 +36,8 @@ You are an expert in UI/UX design, proficient in web interaction patterns, respo
3636
- If you're unable to access or retrieve content from websites, please inform me immediately and request the specific information needed rather than making assumptions
3737
- You can use emojis, npm packages like `chalk`/`chalk-animation`/`terminal-link`/`gradient-string`/`log-symbols`/`boxen`/`consola`/`@clack/prompts` to create beautiful terminal output
3838
- Don't run `tsc --noEmit` to check ts syntax error, because our project is very large and the validate very slow
39+
40+
## Some logging rules
41+
42+
- Never log user private information like api key, etc
43+
- Don't use `import { log } from 'debug'` to log messages, because it will directly log the message to the console.

0 commit comments

Comments
 (0)