app icon indicating copy to clipboard operation
app copied to clipboard

Still seeing three numbers in random suffix for custom domain

Open utf8please opened this issue 1 year ago • 4 comments

Prerequisites

  • [x] I have searched open and closed issues to make sure that the bug has not yet been reported.

Bug report

Describe the bug

#1670 seems to make the suffix shorter for custom domains (1 word only compared to 1 word + 3 digits). However, when I create a random alias on app.simplelogin.io, it still generates in the format of [email protected].

Detailed steps:

  1. In Settings > Aliases, set "Based on Random Words", (my domain), "Random word from our dictionary" in that order
  2. On the dashboard page, click on the green "Random Alias" button (or the dropdown "By Random Words")

The same behavior can be observed through the API as well. I tried looking through the code but I cannot find any obvious causes -- I'm not familiar with the code base.

Expected behavior

It should generate aliases in the format of [email protected] instead.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (If applicable):

  • OS: Linux
  • Browser: Firefox
  • Version 111

Additional context

Two months ago, the format was word_word@. After #1625, the format became wordword123@ and I verified that is indeed the case last month. I did not observe any behavior change due to #1670 but I now see the extra underscore introduced by #1673 (word_word123@) so I assume this has been pushed to app.simplelogin.io in v4.24.0.

Unfortunately, I do not have a self-hosted instance to play with or troubleshoot and I find it quite hard to determine what version is running on app.simplelogin.io. It would be nice if the version number can be included on a corner of the page.

utf8please avatar Apr 27 '23 04:04 utf8please

Can I add to this comment that I WANT three numbers in the suffix of my custom domain. Can this be an option??

purple-emily avatar Jun 22 '23 22:06 purple-emily

I was also curious about this (er, frustrated that the setting "use random word for suffix" didn't work as advertised :sweat_smile: - where were the numbers coming from?), and did some digging.

Creating a random alias via the dashboard calls Alias.create_new_random: index.py.

Creating a random alias via the API also seems to call Alias.create_new_random (see note below for nuances): new_random_alias.py.

Alias.create_new_random calls generate_random_alias_email for both custom domains and SL domains: models.py.

generate_random_alias_email calls random_words(2, 3): see models.py, which explains the current behaviour; you get 2 words and 3 digits.


https://github.com/simple-login/app/pull/1670 modifies get_random_alias_suffix which is called by get_alias_suffixes in alias_suffix.py. get_alias_suffixes does get used by the API (new_random_alias.py); however, for custom domains, get_alias_suffixes only actually uses get_random_alias_suffix if random prefix generation is enabled. In any case, it doesn't seem like creating a random alias via the dashboard touches the code path changed by https://github.com/simple-login/app/pull/1670.

Raekye avatar Aug 05 '23 11:08 Raekye

Also something maybe worth noting/being clear about: based on the code path from Alias.create_new_random (which is always used by the dashboard, and conditionally by the API), as far as I can tell - the default suffix generator setting has no effect; either a UUID is used, or 2 random words + 3 digits are used.

Raekye avatar Aug 05 '23 15:08 Raekye

Can we have an update on this one? It is really frustrating, the setting doesn't do what it is supposed to.

wohfab avatar Feb 05 '24 08:02 wohfab