mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 17:26:23 +02:00
fix(linear): use .astext for JSONB text extraction in _resolve_issue
cast(document_metadata["key"], String) generates CAST(col->'key' AS TEXT) which preserves JSON string quotes (e.g. '"Fix login bug"'), causing case-insensitive comparisons to never match. Replace with .astext which generates the ->> operator (unquoted text extraction), making issue lookups by title and identifier work correctly.
This commit is contained in:
parent
090b69cf1e
commit
9b838ec015
1 changed files with 3 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
from sqlalchemy import String, and_, cast, func, or_
|
from sqlalchemy import and_, func, or_
|
||||||
from sqlalchemy.ext.asyncio import AsyncSession
|
from sqlalchemy.ext.asyncio import AsyncSession
|
||||||
from sqlalchemy.future import select
|
from sqlalchemy.future import select
|
||||||
|
|
||||||
|
|
@ -296,11 +296,11 @@ class LinearToolMetadataService:
|
||||||
SearchSourceConnector.user_id == user_id,
|
SearchSourceConnector.user_id == user_id,
|
||||||
or_(
|
or_(
|
||||||
func.lower(
|
func.lower(
|
||||||
cast(Document.document_metadata["issue_title"], String)
|
Document.document_metadata["issue_title"].astext
|
||||||
)
|
)
|
||||||
== ref_lower,
|
== ref_lower,
|
||||||
func.lower(
|
func.lower(
|
||||||
cast(Document.document_metadata["issue_identifier"], String)
|
Document.document_metadata["issue_identifier"].astext
|
||||||
)
|
)
|
||||||
== ref_lower,
|
== ref_lower,
|
||||||
func.lower(Document.title) == ref_lower,
|
func.lower(Document.title) == ref_lower,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue