Skip to content

Commit 26c67d7

Browse files
committed
Merge pull request #15 from sqlrsync/v0.0.5
v0.0.5 release
2 parents 212ef16 + 9fa7020 commit 26c67d7

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

client/go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
55
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
66
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
77
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
8-
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
9-
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
108
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
119
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
1210
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=

client/remote/client.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ type Config struct {
405405
AuthKey string
406406
ClientVersion string // version of the client software
407407
SendKeyRequest bool // the -sqlrsync file doesn't exist, so make a key
408+
AuthToken string
408409

409410
SendConfigCmd bool // we don't have the version number or remote path
410411
LocalHostname string
@@ -702,6 +703,14 @@ func (c *Client) Connect() error {
702703
c.logger.Fatal("No wsID provided for X-ClientID header")
703704
}
704705

706+
headers.Set("X-ClientVersion", c.config.ClientVersion)
707+
708+
if c.config.WsID != "" {
709+
headers.Set("X-ClientID", c.config.WsID)
710+
} else {
711+
c.logger.Fatal("No wsID provided for X-ClientID header")
712+
}
713+
705714
if c.config.LocalHostname != "" {
706715
headers.Set("X-LocalHostname", c.config.LocalHostname)
707716
}

client/sync/coordinator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ func (c *Coordinator) executePushSubscribe() error {
831831
} else {
832832
defer c.subManager.Close()
833833
fmt.Println("✅ Subscribed to remote updates - will pull new versions automatically")
834-
834+
835835
// Start goroutine to handle pull notifications
836836
go c.handlePullNotifications()
837837
}
@@ -1212,7 +1212,7 @@ func (c *Coordinator) sendMergeConflictNotification(serverURL, replicaName, vers
12121212
// handlePullNotifications runs in a goroutine to listen for remote updates and pull them
12131213
func (c *Coordinator) handlePullNotifications() {
12141214
c.logger.Info("Starting pull notification handler")
1215-
1215+
12161216
for {
12171217
select {
12181218
case <-c.ctx.Done():
@@ -1283,7 +1283,7 @@ func (c *Coordinator) waitForVersionAndPull(isBackground bool) error {
12831283
} else {
12841284
fmt.Printf("🔄 New version %s announced at %s!\n", version, time.Now().Format(time.RFC3339))
12851285
}
1286-
1286+
12871287
// Update version for the pull
12881288
oldVersion := c.config.Version
12891289
if version != "latest" {
@@ -1300,7 +1300,7 @@ func (c *Coordinator) waitForVersionAndPull(isBackground bool) error {
13001300
}
13011301
return err
13021302
}
1303-
1303+
13041304
if isBackground {
13051305
fmt.Printf("✅ Successfully pulled version %s at %s\n", version, time.Now().Format(time.RFC3339))
13061306
}

0 commit comments

Comments
 (0)