Skip to content

Bug in deltaLink regex pattern to get deltaToken #196

@hreiten

Description

@hreiten

Expected behavior

A request to the delta API with non-empty deltaLink provided should return users modified as per the deltaToken in the link.

UserDeltaCollectionRequest.deltaLink(deltaLink) should add the deltaToken to the request.

BaseDeltaCollectionRequest.getDeltaTokenFromLink(deltaLink) should return abc from the string https://graph.microsoft.com/v1.0/users/microsoft.graph.delta?$deltatoken=abc

Actual behavior

UserDeltaCollectionRequest.deltaLink(deltaLink) adds an empty string, because BaseDeltaCollectionRequest.getDeltaTokenFromLink(deltaLink) returns an empty string.

Steps to reproduce the behavior

Use the delta API with non-empty deltaLink provided.

Likely cause and fix.

There seems to be an error in the regex pattern used in the BaseDeltaCollectionRequest.getDeltaTokenFromLink(deltaLink) function.
Current pattern is: "(?i)(?>\$?delta)?token=['"]?([\w-\.]+)"
The following pattern should work: "(?i)(?>\$?delta)?token=['"]?([\w\-\.]+)", where the missing escape before "-" is added.

AB#9300

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfixed

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions