Commit cda94fd
authored
Hotfix/2.6.0 (#2233)
This pull request introduces a new normalized table for message-citation
relations, updates citation repository logic to support both legacy and
new models, and improves error handling and logging. It also updates the
project version to `2.6.0-fix` and ensures all relevant containers use
the new image tag.
**Message-Citation Relation Normalization:**
* Added `MessageCitationRelation` and `MessageCitationRelationBase`
models to represent the association between messages and citations,
including a unique constraint on `(message_id, citation_id)`
(`[[1]](diffhunk://#diff-186aa205991c0eac4a1387fdf8e234009fae675f94ed330d04a3310bc1f8d18cR34-R67)`,
`[[2]](diffhunk://#diff-8cdbc5b6b1f410bf0bca612f26079028955deb6a664953ce88957d1f9aaea4b6L1-R13)`,
`[[3]](diffhunk://#diff-1d8ee5758e663e5b5e7659c59a1be5d82d1e1a8b5a3c6730ce3a42ae33a5f32dL1-R13)`).
* Created new repository methods in `MessageCitationRepositoryImpl` for
ensuring citations and relations exist (with race condition handling),
and for querying citations through both the new relation table and
legacy model
(`[[1]](diffhunk://#diff-0b2053b79f9ba1ce49a7e592bad4024baaf7ad5c43b081dd4f1dd1110858931eL18-R178)`,
`[[2]](diffhunk://#diff-0b2053b79f9ba1ce49a7e592bad4024baaf7ad5c43b081dd4f1dd1110858931eL69-R322)`).
**Repository and Query Logic Updates:**
* Updated all relevant repository methods to support both the new
normalized relation table and the legacy citation ownership, including
deduplication and ordering helpers
(`[[1]](diffhunk://#diff-0b2053b79f9ba1ce49a7e592bad4024baaf7ad5c43b081dd4f1dd1110858931eL18-R178)`,
`[[2]](diffhunk://#diff-0b2053b79f9ba1ce49a7e592bad4024baaf7ad5c43b081dd4f1dd1110858931eL69-R322)`).
* Added batch creation and retrieval methods for citations and
relations, with both async and sync variants
(`[[1]](diffhunk://#diff-0b2053b79f9ba1ce49a7e592bad4024baaf7ad5c43b081dd4f1dd1110858931eL18-R178)`,
`[[2]](diffhunk://#diff-0b2053b79f9ba1ce49a7e592bad4024baaf7ad5c43b081dd4f1dd1110858931eL69-R322)`).
**Error Handling and Logging Improvements:**
* Updated logging to use `logger.opt(exception=True).warning(...)`
instead of passing `exc_info=`, which is not supported by loguru and can
cause runtime errors
(`[[1]](diffhunk://#diff-28b48f7c52734619b80a958f872695c431f29f8e180ee63ac3ff152ccedbb302L310-R310)`,
`[[2]](diffhunk://#diff-5fd402ae0d329b78a7cb9bce444327d8045c72c13b7223b5832e2ec3830ddcd8R31)`).
**Version and Deployment Updates:**
* Bumped the backend and frontend version to `2.6.0-fix` in
`__init__.py` and `docker-compose.yml` to ensure all services use the
updated code and images
(`[[1]](diffhunk://#diff-6593331a7fecd32e889ab36d3ef3c414587b13d753f28bf59b5f311c5c8f9daeL7-R7)`,
`[[2]](diffhunk://#diff-423deb13b7c401b1a7f41ee91c77f722e11d2f317d6a66b546524e8a04cc8b03L84-R84)`,
`[[3]](diffhunk://#diff-423deb13b7c401b1a7f41ee91c77f722e11d2f317d6a66b546524e8a04cc8b03L126-R126)`,
`[[4]](diffhunk://#diff-423deb13b7c401b1a7f41ee91c77f722e11d2f317d6a66b546524e8a04cc8b03L159-R159)`).
**Dependency and Import Adjustments:**
* Updated imports to include new models and handle additional
dependencies required by the new logic
(`[[1]](diffhunk://#diff-186aa205991c0eac4a1387fdf8e234009fae675f94ed330d04a3310bc1f8d18cL4-R4)`,
`[[2]](diffhunk://#diff-0b2053b79f9ba1ce49a7e592bad4024baaf7ad5c43b081dd4f1dd1110858931eL2-R7)`).
These changes collectively migrate citation management to a more
normalized structure, improve reliability under concurrent access, and
address logging pitfalls.73 files changed
Lines changed: 5866 additions & 1167 deletions
File tree
- docker
- src
- backend
- bisheng_langchain/gpts/tools/code_interpreter
- bisheng
- api/services
- citation/domain
- models
- repositories
- implementations
- interfaces
- services
- core
- database
- vectorstore
- knowledge
- domain
- models
- services
- rag/pipeline/loader/utils
- linsight
- domain
- services
- permission/domain/services
- user/domain/services
- utils
- workflow
- common
- nodes
- knowledge_retriever
- qa_retriever
- rag
- workstation/domain/services
- scripts
- test
- citation
- common
- knowledge
- linsight
- permission
- workflow
- workstation
- frontend
- client/src
- api
- components
- Chat
- Linsight/Artifacts
- hooks
- locales
- en
- ja
- zh-Hans
- platform/src
- pages/BuildPage/flow/FlowNode/component
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
| 310 | + | |
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
2 | 7 | | |
3 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
2 | 7 | | |
3 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Lines changed: 35 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
0 commit comments