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

The difference of data structures in Firestore version and HTTP version can cause confusion for the enduser #24

Open
MerlinOfCode opened this issue Feb 2, 2024 · 20 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@MerlinOfCode
Copy link

Could anyone be so kind as to point out to me any mistake in the way I am structuring this firestore doc, as to the config and chrome options? I canot seem to get this extension to work and have gone over it for a week? Any help would be much appreciated.
scrnli_2_2_2024_12-49-07 PM

@sassanh
Copy link
Member

sassanh commented Feb 2, 2024

It must have been so frustrating to spend a week trying to make it work. I'm really sorry to hear about this.

I will quickly check the Firebase version and get back to you.

@sassanh
Copy link
Member

sassanh commented Feb 2, 2024

One issue I immediately notice is you are putting all the data in a map field named data, this is not the correct data structure for the Firebase version, all the data should be in the root of the document like this:
image

It is mentioned here

If it still doesn't work for you, please follow the steps mentioned in this comment and copy the logs here so that we can investigate it further.

@MerlinOfCode
Copy link
Author

Thank you. I had it like that at first, but then when I downloaded your invoice template, the json was structured like i have it. I will try to place the items at root and see if that works. Thank you so much for the fast reply!

@sassanh
Copy link
Member

sassanh commented Feb 2, 2024

I see where the problem comes from now; that JSON is to be used for the HTTP extension, not the Firestore extension. I will try to find a way to avoid this misunderstanding. Let's keep this issue open until it is addressed.

@MerlinOfCode
Copy link
Author

I still cant get it to work. I removed most of the template helper functions, all but the 'for each' for the rows and simply created mustache placeholders for each off these items. Cant figure out what i am doing wrong, and the logs say "finished with status ok".

scrnli_2_2_2024_3-30-14 PM

@MerlinOfCode
Copy link
Author

here is the relavent section of my template:

`


Date: {{date}}


Invoice ID: {{invoiceId}}


Bill to

{{billContactName}}
{{billClientCompany}}
{{billAddress}}
{{billPhone}}
{{billEmail}}

Ship to

{{shipNameOrDept}}
{{shipClientCompany}}
{{shipAddress}}
{{shipPhone}}
{{#each rows}} {{/each}}
Description Qty Unit Price Total
{{description}} {{qnty}} ${{unitPrice}} ${{total}}
SUBTOTAL ${{subtotal}}
DISCOUNT ${{discount}}
TAX RATE {{taxRate}}%
TOTAL TAX ${{totalTax}}
BALANCE DUE ${{total}}
`

@MerlinOfCode
Copy link
Author

These are the logs in the 'info' section of firestore. I will try to upload them in an order where they are understandable.
scrnli_2_2_2024_3-52-39 PM
scrnli_2_2_2024_3-52-11 PM
scrnli_2_2_2024_3-51-00 PM
scrnli_2_2_2024_3-50-09 PM
scrnli_2_2_2024_3-30-14 PM

@sassanh
Copy link
Member

sassanh commented Feb 2, 2024

Mine looks like this:
image
Please close entries and provide a complete screenshot that contains the execution since the function started until it finishes, like the screenshot I provided above.

@MerlinOfCode
Copy link
Author

Min stops at Running action 'load template' and goes no further
scrnli_2_2_2024_3-50-09 PM

@MerlinOfCode
Copy link
Author

MerlinOfCode commented Feb 2, 2024

I'm going to try to completely uninstall the extension and reinstall. Should I increase the memory allocated for the function? It seems 1g should be plenty

@sassanh
Copy link
Member

sassanh commented Feb 2, 2024

I'm not sure if reinstalling helps.
It's weird that it doesn't show anything after this, after a while, it should show a timeout message.

Btw, the issue is with your template file, the zip file, if it doesn't have any private information in it, you can share it here and I will check it for you.

@MerlinOfCode
Copy link
Author

Thank you. Here it is.

invoice-01.zip

@sassanh
Copy link
Member

sassanh commented Feb 2, 2024

I ran your template and it works for me, I think you are not copy complete logs, you need to click on this button at the right side of the timeline to get latest logs. The function eventually finishes running and this is not related to our extension, all google cloud functions have a timeout and after that they are terminated and this even is logged but your logs doesn't include the final resolution of the function.
image

Btw, the issue should be that the template is not accessible for the extension, most probably it is not in the location provided in "templatePath" parameter or the extension doesn't have the permission to read it, providing complete logs can help to understand the situation better.

@sassanh
Copy link
Member

sassanh commented Feb 2, 2024

In your screenshot:
image
The name of the template is invoice-1.zip, but the file you provided for me is invoice-01.zip (with digit zero behind digit 1)

@MerlinOfCode
Copy link
Author

Oh my goodness. And I looked at that a thousand times. Thank you so much!

@MerlinOfCode
Copy link
Author

Too much debugging makes me dislexic :(

@MerlinOfCode
Copy link
Author

Works perfect now, thank you so much. Now I'm going to see if you guys have a good solution for online signinh.

@sassanh sassanh added the documentation Improvements or additions to documentation label Feb 2, 2024
@sassanh sassanh self-assigned this Feb 2, 2024
@sassanh sassanh changed the title Cannot seem to get extension to worlk - any help? The difference of data structures in Firestore version and HTTP version can cause confusion for the enduser Feb 2, 2024
@MerlinOfCode
Copy link
Author

sorry i was tired. so embarrasing but you are a refreshing example of a great person

@MerlinOfCode
Copy link
Author

maybe just comment some code under the json, e.g, //if you are using firebase documents, structure it like this...

@sassanh
Copy link
Member

sassanh commented Feb 6, 2024

I'm glad you can eventually use it, let's keep this issue open until I update documentation if it's ok with you.

@sassanh sassanh reopened this Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants