Skip to content

Commit d4aeb79

Browse files
author
TeleGhost Dev
committed
fix: increase handshake timeout to 60s and use app data dir for reseed export
1 parent 5474bdd commit d4aeb79

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

internal/appcore/messages.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ func (a *AppCore) SendText(contactID, text, replyToID string) error {
5353
log.Printf("[AppCore] Handshake failed: %v", err)
5454
}
5555

56-
// Wait for handshake completion (up to 10 seconds)
56+
// Wait for handshake completion (up to 60 seconds)
5757
log.Printf("[AppCore] Waiting for handshake with %s...", contact.Nickname)
58-
for i := 0; i < 20; i++ {
58+
for i := 0; i < 120; i++ {
5959
time.Sleep(500 * time.Millisecond)
6060
updatedContact, err := a.Repo.GetContact(a.Ctx, contactID)
6161
if err == nil && updatedContact != nil && updatedContact.PublicKey != "" {

internal/appcore/reseed.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ func (a *AppCore) ExportReseed() (string, error) {
5858
}
5959
selectedFiles := files[:count]
6060

61-
// 4. Создаем ZIP архив во временной папке
62-
tmpDir := os.TempDir()
61+
// 4. Создаем ZIP архив во временной папке внутри DataDir (для Android)
62+
tmpDir := filepath.Join(a.DataDir, "tmp")
63+
os.MkdirAll(tmpDir, 0700)
6364
archiveName := fmt.Sprintf("i2p_reseed_%s.zip", time.Now().Format("20060102_150405"))
6465
archivePath := filepath.Join(tmpDir, archiveName)
6566

0 commit comments

Comments
 (0)