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

Bug in treatment of block comments #32

Open
cleve-fauna opened this issue Jan 3, 2023 · 1 comment
Open

Bug in treatment of block comments #32

cleve-fauna opened this issue Jan 3, 2023 · 1 comment

Comments

@cleve-fauna
Copy link
Contributor

cleve-fauna commented Jan 3, 2023

Entering a string like */**/* will cause the string to be interpreted by the severless plugin as ** as the /**/ will be falsely identified as a block comment and stripped from the input.

Relevant source code:

https://github.com/fauna-labs/serverless-fauna/blob/main/fauna/baseEvalFqlQuery.js#L45-L62

Reproduce:

~/workplace >> sls fauna deploy -c poc_config.yml
Fauna: Schema updating in process...
Fauna: Schema up to date
Fauna: Schema updating in process...
Fauna: function `poc` was created
 ✨  Done in 5.73s.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
~/workplace » fsl   
Connected to http://localhost:8443
Type Ctrl+D or .exit to exit the shell
 > Call(Function("poc"))
'**' 
 > Get(Function("poc"))
{
  ref: Function("poc"),
  ts: 1672775182900000,
  name: 'poc',
  body: Query(Lambda("x", "**")),
  data: { created_by_serverless_plugin: true, deletion_policy: 'retain' }
}
 > .exit
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
~/workplace » cat poc.fql     
Lambda("x", "*/**/*")
@cleve-fauna
Copy link
Contributor Author

Proposed fix: #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant