extensions icon indicating copy to clipboard operation
extensions copied to clipboard

[delete-user-data] Paths aren't recognized when there is a space after a comma

Open rafoolin opened this issue 1 year ago • 6 comments

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs for a specific extension in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow with the firebase tag.
  • For general Firebase discussion, use the firebase-talk google group.
  • To file a bug against the Firebase Extensions platform, or for an issue affecting multiple extensions, please reach out to Firebase support directly.

[REQUIRED] Step 2: Describe your configuration

  • Extension name: delete-user-data
  • Extension version: 0.1.13
  • Configuration values (redact info where appropriate):
    • Cloud Storage paths: {DEFAULT}/files/{UID},{DEFAULT}/profile_images/{UID}.png

[REQUIRED] Step 3: Describe the problem

I checked this issue, I had the same problem and changed {DEFAULT} to project-id.appspot.com. This didn't help.

The problem is that folder with UID at {DEFAULT}/files/{UID} will be deleted, but UID.png at {DEFAULT}/profile_images/{UID}.png won't be recognized and in the log it says the path is not found.

Steps to reproduce:

What happened? How can we make the problem occur? I noticed if we have space after , between paths it fails. For example:

{DEFAULT}/a/{UID}, {DEFAULT}/b/{UID}.png, {DEFAULT}/c/{UID}

a will be OK, but b and c will not be found by the extension.

When I removed the space after , it is OK and a, b and c are recognized by the extension.

Expected result

Maybe it would be better if the spaces were ignored or at least mentioned in the description.

Actual result

Comma-separated paths will not be recognized correctly if there is a space after them.

rafoolin avatar Jul 20 '22 18:07 rafoolin

@dackers86 I am working on it. I am planning to trim the paths before processing. Should I go ahead with the above solution or you have something else in your mind?

ankit-programmer avatar Jul 20 '22 20:07 ankit-programmer

@ankit-programmer Thanks!

You're correct that there shouldn't be any spaces. A trim solution would be great 👍🏻

dackers86 avatar Jul 20 '22 20:07 dackers86

@dackers86 Please take a look at PR #1056

ankit-programmer avatar Jul 20 '22 21:07 ankit-programmer

Hey @huangjeff5 what is your opinion on this? Technically paths could contain leading spaces i think, which would be a problem if we trimmed.

cabljac avatar Oct 27 '22 09:10 cabljac

Yeah, I think there is a risk of bugs because of leading spaces. In general we should solve this problem with richer param inputs that let you provide a list of text inputs. We're toying with the richer params actually. It's not on the roadmap just yet, but it would be the long term solution to this paths input issue.

huangjeff5 avatar Nov 15 '22 18:11 huangjeff5

Adding to blocked based on a potential richer params option in the future.

dackers86 avatar Dec 15 '22 14:12 dackers86