@@ -207,59 +207,59 @@ export function testFallbacking(fetchMock, assert) {
207207
208208 } ) ;
209209
210- fetchMock . getOnce ( url ( settings , `/v2/auth?users=${ encodeURIComponent ( userKey ) } ` ) , function ( url , opts ) {
210+ fetchMock . getOnce ( url ( settings , `/v2/auth?s=1.1& users=${ encodeURIComponent ( userKey ) } ` ) , function ( url , opts ) {
211211 if ( ! opts . headers [ 'Authorization' ] ) assert . fail ( '`/v2/auth` request must include `Authorization` header' ) ;
212212 assert . pass ( 'auth success' ) ;
213213 return { status : 200 , body : authPushEnabledNicolas } ;
214214 } ) ;
215215
216216 // initial split and mySegment sync
217- fetchMock . getOnce ( url ( settings , '/splitChanges?since=-1' ) , { status : 200 , body : splitChangesMock1 } ) ;
217+ fetchMock . getOnce ( url ( settings , '/splitChanges?s=1.1& since=-1' ) , { status : 200 , body : splitChangesMock1 } ) ;
218218 fetchMock . getOnce ( url ( settings , '/mySegments/nicolas%40split.io' ) , { status : 200 , body : mySegmentsNicolasMock1 } ) ;
219219
220220 // split and segment sync after SSE opened
221- fetchMock . getOnce ( url ( settings , '/splitChanges?since=1457552620999' ) , { status : 200 , body : { splits : [ ] , since : 1457552620999 , till : 1457552620999 } } ) ;
221+ fetchMock . getOnce ( url ( settings , '/splitChanges?s=1.1& since=1457552620999' ) , { status : 200 , body : { splits : [ ] , since : 1457552620999 , till : 1457552620999 } } ) ;
222222 fetchMock . getOnce ( url ( settings , '/mySegments/nicolas%40split.io' ) , { status : 200 , body : mySegmentsNicolasMock1 } ) ;
223223
224224 // fetches due to first fallback to polling
225- fetchMock . getOnce ( url ( settings , '/splitChanges?since=1457552620999' ) , { status : 200 , body : { splits : [ ] , since : 1457552620999 , till : 1457552620999 } } ) ;
225+ fetchMock . getOnce ( url ( settings , '/splitChanges?s=1.1& since=1457552620999' ) , { status : 200 , body : { splits : [ ] , since : 1457552620999 , till : 1457552620999 } } ) ;
226226 fetchMock . getOnce ( url ( settings , '/mySegments/nicolas%40split.io' ) , { status : 200 , body : mySegmentsNicolasMock1 } ) ;
227- fetchMock . getOnce ( url ( settings , '/splitChanges?since=1457552620999' ) , function ( ) {
227+ fetchMock . getOnce ( url ( settings , '/splitChanges?s=1.1& since=1457552620999' ) , function ( ) {
228228 const lapse = Date . now ( ) - start ;
229229 assert . true ( nearlyEqual ( lapse , MILLIS_STREAMING_DOWN_OCCUPANCY + settings . scheduler . featuresRefreshRate ) , 'fetch due to first fallback to polling' ) ;
230230 return { status : 200 , body : { splits : [ ] , since : 1457552620999 , till : 1457552620999 } } ;
231231 } ) ;
232232 fetchMock . getOnce ( url ( settings , '/mySegments/nicolas%40split.io' ) , { status : 200 , body : mySegmentsNicolasMock1 } ) ;
233233
234234 // split and segment sync due to streaming up (OCCUPANCY event)
235- fetchMock . getOnce ( url ( settings , '/splitChanges?since=1457552620999' ) , { status : 200 , body : { splits : [ ] , since : 1457552620999 , till : 1457552620999 } } ) ;
235+ fetchMock . getOnce ( url ( settings , '/splitChanges?s=1.1& since=1457552620999' ) , { status : 200 , body : { splits : [ ] , since : 1457552620999 , till : 1457552620999 } } ) ;
236236 fetchMock . getOnce ( url ( settings , '/mySegments/nicolas%40split.io' ) , { status : 200 , body : mySegmentsNicolasMock1 } ) ;
237237
238238 // creating of second client during streaming: initial mysegment sync, reauth and syncAll due to new client
239239 fetchMock . getOnce ( url ( settings , '/mySegments/marcio%40split.io' ) , { status : 200 , body : mySegmentsMarcio } ) ;
240- fetchMock . get ( { url : url ( settings , `/v2/auth?users=${ encodeURIComponent ( userKey ) } &users=${ encodeURIComponent ( secondUserKey ) } ` ) , repeat : 3 /* initial + 2 STREAMING_RESET */ } , ( url , opts ) => {
240+ fetchMock . get ( { url : url ( settings , `/v2/auth?s=1.1& users=${ encodeURIComponent ( userKey ) } &users=${ encodeURIComponent ( secondUserKey ) } ` ) , repeat : 3 /* initial + 2 STREAMING_RESET */ } , ( url , opts ) => {
241241 if ( ! opts . headers [ 'Authorization' ] ) assert . fail ( '`/v2/auth` request must include `Authorization` header' ) ;
242242 assert . pass ( 'second auth success' ) ;
243243 return { status : 200 , body : authPushEnabledNicolasAndMarcio } ;
244244 } ) ;
245- fetchMock . getOnce ( url ( settings , '/splitChanges?since=1457552620999' ) , { status : 200 , body : { splits : [ ] , since : 1457552620999 , till : 1457552620999 } } ) ;
245+ fetchMock . getOnce ( url ( settings , '/splitChanges?s=1.1& since=1457552620999' ) , { status : 200 , body : { splits : [ ] , since : 1457552620999 , till : 1457552620999 } } ) ;
246246 fetchMock . getOnce ( url ( settings , '/mySegments/nicolas%40split.io' ) , { status : 200 , body : mySegmentsNicolasMock1 } ) ;
247247 fetchMock . getOnce ( url ( settings , '/mySegments/marcio%40split.io' ) , { status : 200 , body : mySegmentsMarcio } ) ;
248248
249249 // fetch due to SPLIT_UPDATE event
250- fetchMock . getOnce ( url ( settings , '/splitChanges?since=1457552620999' ) , function ( ) {
250+ fetchMock . getOnce ( url ( settings , '/splitChanges?s=1.1& since=1457552620999' ) , function ( ) {
251251 const lapse = Date . now ( ) - start ;
252252 assert . true ( nearlyEqual ( lapse , MILLIS_SPLIT_UPDATE_EVENT_DURING_PUSH ) , 'sync due to SPLIT_UPDATE event' ) ;
253253 return { status : 200 , body : splitChangesMock2 } ;
254254 } ) ;
255255
256256 // fetches due to second fallback to polling
257- fetchMock . getOnce ( url ( settings , '/splitChanges?since=1457552649999' ) , { status : 200 , body : { splits : [ ] , since : 1457552649999 , till : 1457552649999 } } ) ;
257+ fetchMock . getOnce ( url ( settings , '/splitChanges?s=1.1& since=1457552649999' ) , { status : 200 , body : { splits : [ ] , since : 1457552649999 , till : 1457552649999 } } ) ;
258258 fetchMock . getOnce ( url ( settings , '/mySegments/nicolas%40split.io' ) , { status : 200 , body : mySegmentsNicolasMock1 } ) ;
259259 fetchMock . getOnce ( url ( settings , '/mySegments/marcio%40split.io' ) , { status : 200 , body : mySegmentsMarcio } ) ;
260260
261261 // continue fetches due to second fallback to polling
262- fetchMock . getOnce ( url ( settings , '/splitChanges?since=1457552649999' ) , function ( ) {
262+ fetchMock . getOnce ( url ( settings , '/splitChanges?s=1.1& since=1457552649999' ) , function ( ) {
263263 const lapse = Date . now ( ) - start ;
264264 assert . true ( nearlyEqual ( lapse , MILLIS_STREAMING_PAUSED_CONTROL + settings . scheduler . featuresRefreshRate ) , 'fetch due to second fallback to polling' ) ;
265265 return { status : 200 , body : { splits : [ ] , since : 1457552649999 , till : 1457552649999 } } ;
@@ -268,7 +268,7 @@ export function testFallbacking(fetchMock, assert) {
268268 fetchMock . getOnce ( url ( settings , '/mySegments/marcio%40split.io' ) , { status : 200 , body : mySegmentsMarcio } ) ;
269269
270270 // split and segment sync due to streaming up (CONTROL event)
271- fetchMock . getOnce ( url ( settings , '/splitChanges?since=1457552649999' ) , { status : 200 , body : { splits : [ ] , since : 1457552649999 , till : 1457552649999 } } ) ;
271+ fetchMock . getOnce ( url ( settings , '/splitChanges?s=1.1& since=1457552649999' ) , { status : 200 , body : { splits : [ ] , since : 1457552649999 , till : 1457552649999 } } ) ;
272272 fetchMock . getOnce ( url ( settings , '/mySegments/nicolas%40split.io' ) , { status : 200 , body : mySegmentsNicolasMock1 } ) ;
273273 fetchMock . getOnce ( url ( settings , '/mySegments/marcio%40split.io' ) , { status : 200 , body : mySegmentsMarcio } ) ;
274274
@@ -280,17 +280,17 @@ export function testFallbacking(fetchMock, assert) {
280280 } ) ;
281281
282282 // fetches due to third fallback to polling (STREAMING_PAUSED), two sync all (two STREAMING_RESET events) and fourth fallback (STREAMING_DISABLED)
283- fetchMock . get ( { url : url ( settings , '/splitChanges?since=1457552649999' ) , repeat : 4 } , { status : 200 , body : { splits : [ ] , since : 1457552649999 , till : 1457552649999 } } ) ;
283+ fetchMock . get ( { url : url ( settings , '/splitChanges?s=1.1& since=1457552649999' ) , repeat : 4 } , { status : 200 , body : { splits : [ ] , since : 1457552649999 , till : 1457552649999 } } ) ;
284284 fetchMock . get ( { url : url ( settings , '/mySegments/nicolas%40split.io' ) , repeat : 4 } , { status : 200 , body : mySegmentsNicolasMock1 } ) ;
285285 fetchMock . get ( { url : url ( settings , '/mySegments/marcio%40split.io' ) , repeat : 4 } , { status : 200 , body : mySegmentsMarcio } ) ;
286286
287287 // Periodic fetch due to polling (mySegments is not fetched due to smart pausing)
288- fetchMock . getOnce ( url ( settings , '/splitChanges?since=1457552649999' ) , function ( ) {
288+ fetchMock . getOnce ( url ( settings , '/splitChanges?s=1.1& since=1457552649999' ) , function ( ) {
289289 const lapse = Date . now ( ) - start ;
290290 assert . true ( nearlyEqual ( lapse , MILLIS_STREAMING_DISABLED_CONTROL + settings . scheduler . featuresRefreshRate ) , 'fetch due to fourth fallback to polling' ) ;
291291 return { status : 200 , body : splitChangesMock3 } ;
292292 } ) ;
293- fetchMock . getOnce ( url ( settings , '/splitChanges?since=1457552669999' ) , function ( ) {
293+ fetchMock . getOnce ( url ( settings , '/splitChanges?s=1.1& since=1457552669999' ) , function ( ) {
294294 const lapse = Date . now ( ) - start ;
295295 assert . true ( nearlyEqual ( lapse , MILLIS_STREAMING_DISABLED_CONTROL + settings . scheduler . featuresRefreshRate * 2 ) , 'fetch due to fourth fallback to polling' ) ;
296296 return { status : 200 , body : { splits : [ ] , since : 1457552669999 , till : 1457552669999 } } ;
0 commit comments