Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex in MigrationsIdGenerator doesn't work for longer strings #20706

Closed
stefanluchian opened this issue Apr 21, 2020 · 2 comments
Closed

Regex in MigrationsIdGenerator doesn't work for longer strings #20706

stefanluchian opened this issue Apr 21, 2020 · 2 comments
Labels
area-migrations closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-bug
Milestone

Comments

@stefanluchian
Copy link

If you have a prefix longer than "yyyyMMddHHmmss".Length, then the Regex doesn't work as expected.

Steps to reproduce

Call this:
MigrationsIdGenerator.GetName("12345678901234567_InitialCreate");

One gets 67_InitialCreate instead of InitialCreate.

Call this:
MigrationsIdGenerator.IsValidId("12345678901234567_InitialCreate");

The Regex should pay attention to the start of the string.
If not, it will incorrectly validate the longer number instead of rejecting it.

Further technical details

EF Core version: 3.1.3
Database provider: not relevant
Target framework: .NET Core 3.1
Operating system: not relevant
IDE: not relevant

ajcvickers pushed a commit that referenced this issue Apr 24, 2020
Correct RegEx

Add assert position at the start of the line in the RegEx.
#20706
@ajcvickers ajcvickers added this to the 5.0.0 milestone Apr 24, 2020
@ajcvickers ajcvickers added closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. area-migrations type-bug labels Apr 24, 2020
@stefanluchian
Copy link
Author

Thanks for solving this for version 5.
Does this mean, that the problem can also be solved for 3.1.x ?

@ajcvickers
Copy link
Member

@stefanluchian The release planning process describes how we determine which issues to patch. This issue doesn't seem like it meets the criteria.

@ajcvickers ajcvickers modified the milestones: 5.0.0, 5.0.0-preview5 May 11, 2020
@ajcvickers ajcvickers modified the milestones: 5.0.0-preview5, 5.0.0 Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-migrations closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-bug
Projects
None yet
Development

No branches or pull requests

2 participants