Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ rusqlite = { version = "0.35", features = ["bundled"] }
refinery = { version = "0.9", features = ["rusqlite"] }
serde = { version = "1", features = ["derive", "rc"] }
serde_json = "1"
url = "2"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
tokio-stream = { version = "0.1", features = ["sync"] }
tokio-tungstenite = { version = "0.26", features = ["rustls-tls-native-roots", "rustls-tls-webpki-roots"] }
Expand Down
16 changes: 16 additions & 0 deletions migrations/V7__add_identity_column.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- V7: notes_cache に同一性キー (identity) 列を追加する (notedeck#1058)。
-- identity は正規化した ActivityPub object id。複数サーバーで観測した同じノートを
-- 束ねるためのキーで、導出規則は src/identity.rs が正本。
--
-- この migration は列追加と索引だけ。既存行の backfill は起動をブロックしないよう
-- `Database::backfill_identity_chunk` で起動後にバックグラウンドで行う
-- (V6 級の全行リライトは起動を分単位で止めるため)。未 backfill 行は '' で、
-- `find_notes_by_identity` は完了まで uri 列でフォールバックする。
--
-- 索引は部分索引にしない: `identity = ?` の束縛パラメータでは部分索引の条件
-- (identity != '') を planner が証明できず索引が使われない。'' 行は索引上で
-- 連続するので backfill のチャンク選択にも同じ索引が効く。

ALTER TABLE notes_cache ADD COLUMN identity TEXT NOT NULL DEFAULT '';

CREATE INDEX IF NOT EXISTS idx_notes_cache_identity ON notes_cache(identity);
4 changes: 4 additions & 0 deletions src/commands/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ pub fn run_accounts(db: &Database, fmt: OutputFormat) -> Result<(), NoteDeckErro
}

pub async fn run_login(db: &Database, host: &str, fmt: OutputFormat) -> Result<(), NoteDeckError> {
// NoteDeck 経路と同じく ASCII 小文字で保存する (accounts の (host, user_id) 一意制約と
// ノートの取得元 host を揃える。notedeck#1058)
let host = host.trim().to_ascii_lowercase();
let host = host.as_str();
let client = MisskeyClient::new()?;

let session_id = uuid::Uuid::new_v4().to_string();
Expand Down
Loading
Loading