gs1 / GS1DigitalLinkCompressionPrototype

Experimental prototype for reversible lossless compression of GS1 Digital Link URIs
Apache License 2.0
8 stars 3 forks source link

Compression of DangerousGoodsParameter #3

Open clementh59 opened 3 years ago

clementh59 commented 3 years ago

Hi Mark,

When I compress this URL : https://dlnkd.tn.gg/01/9780345418913?4321=1 (which is a valid GS1 Digital Link since 4321 is for dangerousGoodsParameter which is a boolean), I get this error :

TypeError: Cannot read property 'test' of undefined
    at GS1DigitalLinkToolkit.verifySyntax (lib/GS1DigitalLinkCompressionPrototype/GS1DigitalLinkToolkit.js:364:27)
    at GS1DigitalLinkToolkit.extractFromGS1digitalLink (lib/GS1DigitalLinkCompressionPrototype/GS1DigitalLinkToolkit.js:1408:11)
    at GS1DigitalLinkToolkit.compressGS1DigitalLink (lib/GS1DigitalLinkCompressionPrototype/GS1DigitalLinkToolkit.js:2285:23)

Do you know where it comes from?

Thanks

mgh128 commented 3 years ago

Hi Clément

The compression toolkit has not yet been updated to support the new AIs from GS1 Scan4Transport. I'm currently updating the v1.2 drafts for the compression and semantics chapters. When I've done that, my next task is to update the toolkits to support those new AIs.

I hope that helps

On Thu, 29 Oct 2020, 14:58 Clément Hecquet, notifications@github.com wrote:

Hi Mark,

When I compress this URL : https://dlnkd.tn.gg/01/9780345418913?4321=1 (which is a valid GS1 Digital Link since 4321 is for dangerousGoodsParameter which is a boolean), I get this error :

TypeError: Cannot read property 'test' of undefined at GS1DigitalLinkToolkit.verifySyntax (lib/GS1DigitalLinkCompressionPrototype/GS1DigitalLinkToolkit.js:364:27) at GS1DigitalLinkToolkit.extractFromGS1digitalLink (lib/GS1DigitalLinkCompressionPrototype/GS1DigitalLinkToolkit.js:1408:11) at GS1DigitalLinkToolkit.compressGS1DigitalLink (lib/GS1DigitalLinkCompressionPrototype/GS1DigitalLinkToolkit.js:2285:23)

Do you know where it comes from?

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gs1/GS1DigitalLinkCompressionPrototype/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSXRLYPBOLMM4S7XARWU2TSNF7K3ANCNFSM4TD3ENGQ .

clementh59 commented 3 years ago

Thanks for your quick answer.

I understand but I don't think this is only a problem with the new AI.

If I try for example : https://dlnkd.tn.gg/gtin/9780345418913?999999=250

999999 should be taken as a custom parameter but I get the same error.

mgh128 commented 3 years ago

I'll investigate next week when I have time. Unfortunately I don't have time to focus on the toolkit this week. Can you confirm that you don't get the same error with https://dlnkd.tn.gg/gtin/9780345418913?a999999=250 in which the custom parameter is not all-numeric?

Thanks

Mark

On Thu, Oct 29, 2020 at 3:45 PM Clément Hecquet notifications@github.com wrote:

Thanks for your quick answer.

I understand but I don't think this is only a problem with the new AI.

If I try for example : https://dlnkd.tn.gg/gtin/9780345418913?999999=250

999999 should be taken as a custom parameter but I get the same error.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gs1/GS1DigitalLinkCompressionPrototype/issues/3#issuecomment-718840926, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSXRLYAGJOEA4SBAV4GHM3SNGEZHANCNFSM4TD3ENGQ .

clementh59 commented 3 years ago

Ok thanks.

Yes, the compression is working with your example. The issue appears only when the parameter is all-numeric.

mgh128 commented 3 years ago

OK, thanks.

It's useful feedback and I'll try to double-check the updates to the compression draft and URI syntax draft and flowcharts to make sure that as far as possible we're not excluding the possibility of all-numeric non-AIs there. It might just be a problem in the toolkit being too restrictive.

Best wishes

Mark

On Thu, Oct 29, 2020 at 3:53 PM Clément Hecquet notifications@github.com wrote:

Ok thanks.

Yes, the compression is working with your example. The issue appears only when the parameter is all-numeric.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gs1/GS1DigitalLinkCompressionPrototype/issues/3#issuecomment-718846416, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSXRL5HL42MYNQ54PDWOHLSNGFYTANCNFSM4TD3ENGQ .

clementh59 commented 3 years ago

Ok, thanks for your help.

Best wishes

mgh128 commented 3 years ago

Hi Clément

I just checked - and section 4.10.1 of the v1.2 draft for the URI Syntax chapter includes the following statement:

Any key=value pairs used for extension data SHALL NOT be all-numeric to avoid conflict with existing and future keys used for GS1 Application Identifiers either in terms of semantics or syntax;

So unfortunately that forbids the use of 999999=250 https://dlnkd.tn.gg/gtin/9780345418913?999999=250 as an extension key=value pair within the URI query string. Not all possible GS1 Application Identifiers have yet been allocated. Although (999999) could not exist because (99) already exists, there are reserved ranges for future GS1 Application Identifiers where the values and number of digits is not rigidly defined. For this reason I think we'll need to keep the rule about not permitting arbitrary all-numeric keys in the URI query string.

Best wishes

Mark

On Thu, Oct 29, 2020 at 4:03 PM Mark Harrison mark.harrison@cantab.net wrote:

OK, thanks.

It's useful feedback and I'll try to double-check the updates to the compression draft and URI syntax draft and flowcharts to make sure that as far as possible we're not excluding the possibility of all-numeric non-AIs there. It might just be a problem in the toolkit being too restrictive.

Best wishes

Mark

On Thu, Oct 29, 2020 at 3:53 PM Clément Hecquet notifications@github.com wrote:

Ok thanks.

Yes, the compression is working with your example. The issue appears only when the parameter is all-numeric.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gs1/GS1DigitalLinkCompressionPrototype/issues/3#issuecomment-718846416, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSXRL5HL42MYNQ54PDWOHLSNGFYTANCNFSM4TD3ENGQ .

clementh59 commented 3 years ago

Hi Mark,

Great, that means it's just an update problem!

Thanks,

Clément

mgh128 commented 3 years ago

Hi Clément

It's an update problem in the sense that I have not yet updated the tools to support the new AIs from Scan4Transport.

However, I don't expect any change to the rule that in the URI query string any other extension key=value pairs must not use all-numeric keys. I don't expect that current rule to be dropped.

I hope that helps

Best wishes

Mark

On Fri, 30 Oct 2020, 06:39 Clément Hecquet, notifications@github.com wrote:

Hi Mark,

Great, that means it's just an update problem!

Thanks,

Clément

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gs1/GS1DigitalLinkCompressionPrototype/issues/3#issuecomment-719290619, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSXRLYYD7ONBZ7JYRVZAELSNJNR3ANCNFSM4TD3ENGQ .

clementh59 commented 3 years ago

Yes of course, I'll update digital-link.js with this problem.

Best wishes

Clément

mgh128 commented 3 years ago

Thanks!

On Fri, 30 Oct 2020, 09:12 Clément Hecquet, notifications@github.com wrote:

Yes of course, I'll update digital-link.js with this problem.

Best wishes

Clément

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gs1/GS1DigitalLinkCompressionPrototype/issues/3#issuecomment-719436304, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSXRL5XGMJC2YWDCF5AYGDSNJ7PBANCNFSM4TD3ENGQ .