Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
389e868
Activate github/workflow
zephyranthes03 Sep 5, 2025
7be0539
Update fmt update
zephyranthes03 Sep 8, 2025
53a7e93
Fix import path from src/bin/rabbit_consumer.rs
zephyranthes03 Sep 8, 2025
539e1a9
Remove crashed marker/Merge import block
zephyranthes03 Sep 8, 2025
ce980ac
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 8, 2025
fb632e8
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 8, 2025
f63361a
Bypass rabbit_consumer code
zephyranthes03 Sep 8, 2025
a53a060
Bypass rabbit_consumer code
zephyranthes03 Sep 8, 2025
e0fa20c
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 8, 2025
fc73fdd
Bypass rabbit_consumer code
zephyranthes03 Sep 8, 2025
12362cf
Update deploy procss
zephyranthes03 Sep 9, 2025
5fdd399
Update cosmic-sync-server health check
zephyranthes03 Sep 9, 2025
f19203b
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 9, 2025
6c879dc
Update cosmic-sync-server health check
zephyranthes03 Sep 9, 2025
1982e98
Update cosmic-sync-server health check
zephyranthes03 Sep 9, 2025
53745b6
Update service loading delay/ Update related service env
zephyranthes03 Sep 10, 2025
c55d84a
Fix build error
zephyranthes03 Sep 10, 2025
a43b5ac
Fix build error
zephyranthes03 Sep 10, 2025
15555aa
Update builder rs
zephyranthes03 Sep 10, 2025
37bc15c
Fix static library issue
zephyranthes03 Sep 10, 2025
987a6a9
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 10, 2025
7cdfe0e
Fix static library issue
zephyranthes03 Sep 10, 2025
12aa27f
Fix static library issue
zephyranthes03 Sep 10, 2025
d015f08
Fix static library issue
zephyranthes03 Sep 10, 2025
53c4809
Update secret location
zephyranthes03 Sep 11, 2025
3c1633f
Check system76/cosmic-sync-server repo
zephyranthes03 Sep 11, 2025
65174ca
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 11, 2025
ea38129
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 11, 2025
51c9b41
Check system76/cosmic-sync-server repo
zephyranthes03 Sep 11, 2025
f66baea
Fix Migration issue
zephyranthes03 Sep 12, 2025
c9b0ce4
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 12, 2025
9134c3c
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 12, 2025
cb41ab1
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 12, 2025
69c18c2
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 12, 2025
7a0ba3a
Fix Migration issue
zephyranthes03 Sep 12, 2025
5c7c781
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 12, 2025
00e2616
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 12, 2025
7b8f4ea
Fix Migration issue
zephyranthes03 Sep 13, 2025
77a767c
Update schema
zephyranthes03 Sep 14, 2025
b34ecc4
git Merge branch 'staging' of github.com:system76/cosmic-sync-server …
zephyranthes03 Sep 14, 2025
c8693d0
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 14, 2025
32dd2c7
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 15, 2025
da1dd7a
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 15, 2025
26bd72b
Fix grpc port connection
zephyranthes03 Sep 15, 2025
d03e4b8
Fix grpc port connection
zephyranthes03 Sep 15, 2025
cb2b8ca
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 15, 2025
f80a24b
Fix grpc port connection
zephyranthes03 Sep 15, 2025
1a07741
git Merge branch 'staging' of github.com:system76/cosmic-sync-server …
zephyranthes03 Sep 15, 2025
7e5baae
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 15, 2025
fb16db2
Fix grpc port connection
zephyranthes03 Sep 15, 2025
477969d
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 15, 2025
1cb4790
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 15, 2025
70f649c
Fix grpc port connection
zephyranthes03 Sep 15, 2025
44f5356
git Merge branch 'staging' of github.com:system76/cosmic-sync-server …
zephyranthes03 Sep 15, 2025
6cff219
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 15, 2025
beafa61
Fix grpc port connection
zephyranthes03 Sep 15, 2025
e7c62fd
Fix grpc port connection
zephyranthes03 Sep 15, 2025
c1d2bc1
Update login process - fix OAUTH infos
zephyranthes03 Sep 19, 2025
3f7b8e0
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 19, 2025
0f2edfd
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 19, 2025
c879fa1
Update login process - fix OAUTH infos
zephyranthes03 Sep 22, 2025
e14710e
Update login process - fix saving auth token
zephyranthes03 Sep 22, 2025
22fe3c8
Merge 443/50051
zephyranthes03 Sep 23, 2025
cae291a
Merge 443/50051
zephyranthes03 Sep 23, 2025
e55115d
Merge 443/50051
zephyranthes03 Sep 24, 2025
00ea3ef
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 24, 2025
1b86395
Merge 443/50051
zephyranthes03 Sep 24, 2025
4b8668a
Merge 443/50051
zephyranthes03 Sep 24, 2025
b05e032
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 24, 2025
24056be
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 24, 2025
c193115
Merge 443/50051
zephyranthes03 Sep 24, 2025
f85eae7
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 24, 2025
d1569a8
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 24, 2025
a035a88
Merge 443/50051
zephyranthes03 Sep 24, 2025
509b93c
Fix http size issue
zephyranthes03 Sep 26, 2025
bda4115
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 26, 2025
1dac212
Fix http size issue
zephyranthes03 Sep 26, 2025
18f0f72
Fix http size issue
zephyranthes03 Sep 26, 2025
2b6c550
Fix http size issue
zephyranthes03 Sep 26, 2025
ad42771
Fix http size issue
zephyranthes03 Sep 26, 2025
98dafbe
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 26, 2025
c652398
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 26, 2025
65c99f0
Fix http size issue
zephyranthes03 Sep 26, 2025
c26386d
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 26, 2025
d849e14
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 26, 2025
266d297
Fix http size issue
zephyranthes03 Sep 26, 2025
34e78d6
Fix http size issue
zephyranthes03 Sep 26, 2025
4331e95
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 26, 2025
aa8fb94
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 26, 2025
7b12ca4
Fix http size issue
zephyranthes03 Sep 27, 2025
2260296
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 27, 2025
26c05fc
Fix http size issue
zephyranthes03 Sep 27, 2025
9c2c299
Fix http size issue
zephyranthes03 Sep 27, 2025
4051873
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 27, 2025
cbfca95
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 27, 2025
c640456
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 27, 2025
f19baac
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 27, 2025
fbe4cc7
Fix http size issue
zephyranthes03 Sep 27, 2025
47ebffb
Fix http size issue
zephyranthes03 Sep 27, 2025
37e11f8
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 27, 2025
5098835
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 27, 2025
47ec562
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Sep 27, 2025
3324e59
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Sep 27, 2025
ca16552
Check point for 2024
zephyranthes03 Sep 27, 2025
b5068f1
Check point for 2024
zephyranthes03 Sep 27, 2025
875870b
Check point for 2024 - fmt
zephyranthes03 Sep 27, 2025
32fe89d
Check point for 2024 - dockerfile
zephyranthes03 Sep 27, 2025
c30060c
Check point for streaming/key_id patch
zephyranthes03 Sep 30, 2025
cbafc38
Fix starting process
zephyranthes03 Oct 1, 2025
948f090
Fix mysql auth_token mismatch
zephyranthes03 Oct 1, 2025
eee66c7
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Oct 1, 2025
c1ec243
Fix starting process
zephyranthes03 Oct 1, 2025
ebd3f03
Fix starting process
zephyranthes03 Oct 1, 2025
9e049c7
Migrate DB table
zephyranthes03 Oct 2, 2025
1e8395a
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Oct 2, 2025
391cb6b
Merge branch 'staging' into fix_rabbit_consumer
zephyranthes03 Oct 2, 2025
937195d
Fix decrption issue
zephyranthes03 Oct 6, 2025
24cbfeb
Fix decrption issue
zephyranthes03 Oct 6, 2025
345bf2b
Fix http health check issue
zephyranthes03 Oct 6, 2025
e1605a8
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Oct 6, 2025
5d50083
Merge branch 'staging' into ussage_update
zephyranthes03 Oct 6, 2025
dbabc56
Fix http health check issue
zephyranthes03 Oct 7, 2025
4d17722
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Oct 7, 2025
0e9b66e
Merge branch 'staging' into ussage_update
zephyranthes03 Oct 7, 2025
46c0b80
Fix ECR issue
zephyranthes03 Oct 7, 2025
1d6e313
Fix device hash mismatch
zephyranthes03 Oct 7, 2025
1a896e7
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Oct 7, 2025
71e6cd0
Merge branch 'staging' into device_hash
zephyranthes03 Oct 7, 2025
7f0dcf5
Fix device hash mismatch
zephyranthes03 Oct 7, 2025
ddbe2b1
Fix device hash mismatch
zephyranthes03 Oct 7, 2025
135ce95
Fix device hash mismatch
zephyranthes03 Oct 7, 2025
93939aa
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Oct 7, 2025
7566d2c
Merge branch 'staging' into device_hash
zephyranthes03 Oct 7, 2025
cf1e3ba
Fix device hash mismatch
zephyranthes03 Oct 7, 2025
8384fed
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Oct 7, 2025
6a3356c
Merge branch 'staging' into device_hash
zephyranthes03 Oct 7, 2025
1e7a439
Fix device hash mismatch
zephyranthes03 Oct 7, 2025
d2d16d5
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Oct 7, 2025
18f68e7
Merge branch 'staging' into device_hash
zephyranthes03 Oct 7, 2025
6cdaa5b
Fix device hash mismatch
zephyranthes03 Oct 7, 2025
4965099
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Oct 7, 2025
2b7e798
Merge branch 'staging' into device_hash
zephyranthes03 Oct 7, 2025
2c0d5ef
Fix timeout issue
zephyranthes03 Oct 7, 2025
420787a
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Oct 7, 2025
c0c895b
Merge branch 'staging' into device_hash
zephyranthes03 Oct 7, 2025
b6804e9
Update http2
zephyranthes03 Oct 7, 2025
445920b
Update http2
zephyranthes03 Oct 7, 2025
0b662a5
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Oct 7, 2025
7a58412
Merge branch 'staging' into device_hash
zephyranthes03 Oct 7, 2025
d3ce936
Update health check
zephyranthes03 Oct 7, 2025
3dc6415
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Oct 7, 2025
af219e0
Merge branch 'staging' into device_hash
zephyranthes03 Oct 7, 2025
ba260c2
Update health check
zephyranthes03 Oct 7, 2025
d6e7efc
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Oct 7, 2025
e05c47c
Merge branch 'staging' into device_hash
zephyranthes03 Oct 7, 2025
f29e200
Update DB schema
zephyranthes03 Oct 7, 2025
843807f
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Oct 7, 2025
7664df4
Merge branch 'staging' into device_hash
zephyranthes03 Oct 7, 2025
5e728c2
Update DB schema
zephyranthes03 Oct 7, 2025
05b23a6
Update proto
zephyranthes03 Oct 8, 2025
65b90d4
Update proto
zephyranthes03 Oct 8, 2025
5fb23a7
Fix login process
zephyranthes03 Oct 8, 2025
5d1655f
Fix login process
zephyranthes03 Oct 8, 2025
b5af9f7
Fix login process
zephyranthes03 Oct 9, 2025
d769dda
Merge branch 'staging' of github.com:system76/cosmic-sync-server into…
zephyranthes03 Oct 9, 2025
3a8bc3d
Merge branch 'staging' into device_hash
zephyranthes03 Oct 9, 2025
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
18 changes: 18 additions & 0 deletions src/auth/oauth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@ pub async fn process_oauth_code(
// 계정 저장 - 재시도 로직 포함
let mut retry_count = 0;
let max_retries = 3;
let mut account_created = false;

while retry_count < max_retries {
match oauth_service.storage.create_account(&new_account).await {
Expand All @@ -764,6 +765,7 @@ pub async fn process_oauth_code(
"✅ New account created successfully: account_hash={}",
account_hash
);
account_created = true;

// 계정 생성 확인
match oauth_service
Expand All @@ -778,6 +780,7 @@ pub async fn process_oauth_code(
error!(
"⚠️ Account not found after creation - may be a database sync issue"
);
account_created = false;
}
Err(e) => {
error!("⚠️ Error verifying account creation: {}", e);
Expand All @@ -796,18 +799,33 @@ pub async fn process_oauth_code(
// Duplicate entry 에러인 경우 재시도하지 않음
if e.to_string().contains("Duplicate") {
info!("ℹ️ Account may already exist, proceeding anyway");
account_created = true; // Duplicate는 계정이 이미 존재한다는 의미
break;
}

retry_count += 1;
if retry_count < max_retries {
// 짧은 대기 후 재시도
tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
} else {
// 최대 재시도 횟수 초과
return Err(AuthError::DatabaseError(format!(
"Failed to create account after {} retries: {}",
max_retries, e
)));
}
}
}
}

// 계정 생성 실패 확인
if !account_created {
return Err(AuthError::DatabaseError(format!(
"Account creation failed but no error was returned. This should not happen. account_hash={}",
account_hash
)));
}

new_account
};

Expand Down
17 changes: 14 additions & 3 deletions src/storage/mysql_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ impl MySqlAccountExt for MySqlStorage {
Ok(_) => {
info!("✅ Transaction committed successfully");

// 약간의 대기 시간을 추가하여 데이터베이스 트리거 완료 대기
tokio::time::sleep(tokio::time::Duration::from_millis(50)).await;

// 새로운 연결을 사용하여 데이터베이스에 실제로 저장되었는지 확인
match sqlx::query_as::<_, (String, String, String, String, i64, i64, i64, bool)>(
r#"SELECT account_hash, email, name, id, created_at, updated_at, last_login, is_active FROM accounts WHERE account_hash = ?"#
Expand All @@ -88,12 +91,22 @@ impl MySqlAccountExt for MySqlStorage {
info!("✅ Verified account exists in database with explicit query");
info!("✅ Account details: hash={}, email={}, name={}, id={}, created_at={}, updated_at={}, last_login={}, is_active={}",
db_hash, db_email, db_name, db_id, db_created, db_updated, db_login, db_active);
return Ok(());
},
Ok(None) => {
error!("❌ Account not found in database after creation: account_hash={}", account.account_hash);
error!("❌ Account not found in database after creation and commit: account_hash={}", account.account_hash);
error!("❌ This likely means the database trigger failed and rolled back the transaction");
return Err(StorageError::Database(format!(
"Account not found after creation - trigger may have failed. account_hash={}",
account.account_hash
)));
},
Err(e) => {
error!("❌ Failed to verify account creation: {}", e);
return Err(StorageError::Database(format!(
"Failed to verify account creation: {}",
e
)));
}
}
}
Expand All @@ -107,8 +120,6 @@ impl MySqlAccountExt for MySqlStorage {
)));
}
}

return Ok(());
}
Err(e) => {
error!("❌ Failed to insert account into database: {}", e);
Expand Down