Removing desktop extention from ID

Hi, it’s a question related to AppData, and while there are some documents available, I wanted to be sure.

There are several apps that use their ID with the .desktop extension.

<id>org.gnome.SwellFoop.desktop</id>

Can I simply remove the .desktop part, because the guidelines say it’s not recommended?

<!-- Good -->
<id>org.flatpak.qtdemo</id>

<!-- Bad -->
<id>org.flatpak.qtdemo.desktop</id>
<id>qtdemo.desktop</id>

Is the .desktop considered part of the ID?

Because the guidelines discourage renaming the app ID.

Renaming ID tag

The ID tag in the MetaInfo file is supposed to be a constant and unique identifier of an application and should not be renamed unless absolutely necessary. source

If I understand correctly, after changing
<id>org.gnome.SwellFoop.desktop to
<id>org.gnome.SwellFoop</id>,

I also need to use the <replaces> and <provides> tags as shown in the following example.

<id>org.gnome.SwellFoop</id>
...
  <replaces>
    <id>org.gnome.SwellFoop.desktop</id>
  </replaces>
...
  <provides>
    <id>org.gnome.SwellFoop.desktop</id>
  </provides>

Thanks.

Adding a .desktop suffix to appstream id tag is a legacy convention and should not be used today.

Can I simply remove the .desktop part, because the guidelines say it’s not recommended?

That’s a recommendation for new apps.

Because the guidelines discourage renaming the app ID.

I would avoid renaming unless absolutely necessary. There is a possibility that the change causes multiple copies of the app to show up in Discover/Software.

In general renaming should be avoided like MetaInfo guidelines | Flathub Documentation says.

The issue with replaces is it is all theoretical and in the spec only, no software app supports that tag. So even if the tag is present software apps won’t merge the two separate instances.