@@ -56,7 +56,7 @@ connection (~50s) and on transient network errors.
5656If <number> is omitted, the trail for the current branch is used.
5757
5858This command resolves the trail's id internally and streams
59- GET /api/v1/review-events?trail_id= <id>& stream=1 .
59+ GET /api/v1/trails/ <id>/reviews/events with Accept: text/event- stream.
6060
6161Events emitted by the server:
6262 ready initial frame, includes trail and cursor
@@ -188,10 +188,10 @@ func resolveTrailWatchTarget(ctx context.Context, client *api.Client, number int
188188 if found == nil {
189189 return "" , "" , fmt .Errorf ("no trail found for branch %q (pass an explicit trail number)" , branch )
190190 }
191- if found .TrailID == "" {
191+ if found .ID == "" {
192192 return "" , "" , fmt .Errorf ("trail for branch %q has no id yet" , branch )
193193 }
194- return found .TrailID , trailWatchDescription (host , owner , repo , found .Number , found .TrailID ), nil
194+ return found .ID , trailWatchDescription (host , owner , repo , found .Number , found .ID ), nil
195195}
196196
197197func resolveTrailWatchNumber (ctx context.Context , client * api.Client , number int ) (trailID , description string , err error ) {
@@ -206,10 +206,10 @@ func resolveTrailWatchNumber(ctx context.Context, client *api.Client, number int
206206 if found == nil {
207207 return "" , "" , fmt .Errorf ("no trail #%d found in %s/%s/%s" , number , host , owner , repo )
208208 }
209- if found .TrailID == "" {
209+ if found .ID == "" {
210210 return "" , "" , fmt .Errorf ("trail #%d has no id yet" , number )
211211 }
212- return found .TrailID , trailWatchDescription (host , owner , repo , found .Number , found .TrailID ), nil
212+ return found .ID , trailWatchDescription (host , owner , repo , found .Number , found .ID ), nil
213213}
214214
215215func trailWatchDescription (host , owner , repo string , number int , trailID string ) string {
@@ -220,10 +220,7 @@ func trailWatchDescription(host, owner, repo string, number int, trailID string)
220220}
221221
222222func reviewEventsPath (trailID string ) string {
223- query := url.Values {}
224- query .Set ("trail_id" , trailID )
225- query .Set ("stream" , "1" )
226- return "/api/v1/review-events?" + query .Encode ()
223+ return "/api/v1/trails/" + url .PathEscape (trailID ) + "/reviews/events"
227224}
228225
229226type streamCloseReason int
0 commit comments