Ringhio bug?

This forum is for general developer support questions.
Post Reply
TomSoniq
Posts: 13
Joined: Sun Jun 19, 2011 2:03 pm

Ringhio bug?

Post by TomSoniq »

Hi!

I've discovered some strange ringhio behaviour which can be reproduced by running the code below like this:
  • Start the Notify program for the first time
    Two popups should be displayed.
    Now open Prefs/Notifications
    You should find two new registered applications: "TestApp-Something" and "TestApp"
    Untick TestApp only but leave TestApp-Something enabled, save settings.
    Start the Notify program again
    This time the second popup should be disabled but it isn't! Both still show up.
    Now do it the other way round: Untick TestApp-Something but tick TestApp
    Start the Notify program again
    This time only the first popup should be disabled but instead none of them shows up.
This also happens when the two notifications are sent from two separate, different executables.
Setting REGAPP_UniqueApplication to TRUE in both instances doesn't change anything either.
It seems as if TestApp automagically inherits the Notification settings from TestApp-Something instead of using its own.
Can you please tell me if this is a bug or if it's intentional? ;)

Code: Select all

;/* NotifyTest
gcc -o Notify Notify.c
quit
*/

#include <stdio.h>
#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/application.h>

struct Library *ApplicationBase = NULL;
struct ApplicationIFace *IApplication = NULL;
uint32 AppID = 0;

int OpenLibs(void) {
	if((DOSBase = IExec->OpenLibrary("dos.library", 52))) {
		if((IDOS  = (APTR)IExec->GetInterface(DOSBase, "main", 1L, NULL))) {
			if((ApplicationBase = IExec->OpenLibrary("application.library", 52))) {
				if((IApplication  = (APTR)IExec->GetInterface(ApplicationBase, "application", 2L, NULL))) {
					return 1;
				}
			}
		}
	}
	return 0;
}

void CloseLibs(void) {
	if(IApplication) IExec->DropInterface((struct Interface *)IApplication);
	if(ApplicationBase) IExec->CloseLibrary(ApplicationBase);
	if(IDOS) IExec->DropInterface((struct Interface *)IDOS);
	if(DOSBase) IExec->CloseLibrary(DOSBase);
}

int main(void) {
	if(OpenLibs()) {
		AppID = IApplication->RegisterApplication("TestApp-Something",
			REGAPP_UniqueApplication, FALSE,
			REGAPP_HasIconifyFeature, TRUE,
		TAG_END);
		if(AppID) {
			printf("TestApp-Something application registered.\n");
			IDOS->Delay(50);
			IApplication->Notify(AppID,
				APPNOTIFY_Title, "TestApp-Something Testing!",
				APPNOTIFY_Text, "One, Two!",
			TAG_END);
			printf("TestApp-Something notification sent.\n");
			IApplication->UnregisterApplication(AppID, NULL);
			printf("TestApp-Something application unregistered.\n");
		}

		AppID = IApplication->RegisterApplication("TestApp",
			REGAPP_UniqueApplication, FALSE,
			REGAPP_HasIconifyFeature, TRUE,
		TAG_END);
		if(AppID) {
			printf("TestApp application registered.\n");
			IDOS->Delay(50);
			IApplication->Notify(AppID,
				APPNOTIFY_Title, "TestApp Testing!",
				APPNOTIFY_Text, "Three, Four!",
			TAG_END);
			printf("TestApp notification sent.\n");
			IApplication->UnregisterApplication(AppID, NULL);
			printf("TestApp application unregistered.\n");
		}
		CloseLibs();
	}
}
TomSoniq
Posts: 13
Joined: Sun Jun 19, 2011 2:03 pm

Re: Ringhio bug?

Post by TomSoniq »

Long story short:

Two registered applications, one called TestApp-Something, the other one TestApp

Disabling TestApp in Ringhio Prefs does nothing.
Disabling TestApp-Something in Ringhio Prefs disables them both.

Any ideas? ;)
User avatar
trixie
Posts: 409
Joined: Thu Jun 30, 2011 2:54 pm
Location: Czech Republic

Re: Ringhio bug?

Post by trixie »

@TomSoniq

Easy to guess: Ringhio prefs disregards the rest of the application name as soon as it finds a non-alphanumeric character, like "-". Perhaps it uses some kind of IsAlpha() test when dealing with the name.
The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
TomSoniq
Posts: 13
Joined: Sun Jun 19, 2011 2:03 pm

Re: Ringhio bug?

Post by TomSoniq »

Tried removing the dash: Same thing
Called second instance TestApp-Different: Everything ok.

So it seems as if the Ringhio server only does the string compare until the length of the shorter string is reached.

Registering an application called Ami is fun. To make it shut up you have to disable AmiUpdate, AmiDock, etc.. in Ringhio prefs. :?
User avatar
trixie
Posts: 409
Joined: Thu Jun 30, 2011 2:54 pm
Location: Czech Republic

Re: Ringhio bug?

Post by trixie »

@TomSoniq
So it seems as if the Ringhio server only does the string compare until the length of the shorter string is reached.
Surely looks like bogus string comparison. Now all we have to do is keep posting in this thread until somebody in charge notices it and files a bug report. Your turn, Tom :-)
The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
User avatar
ZeroG
Posts: 124
Joined: Sat Jun 18, 2011 11:31 am
Location: Germany

Re: Ringhio bug?

Post by ZeroG »

@TomSoniq
Maybe you should send a pm / email to m3x, as far as i know ringhio is his project.
kas1e
Beta Tester
Beta Tester
Posts: 542
Joined: Sat Jun 18, 2011 7:56 am
Contact:

Re: Ringhio bug?

Post by kas1e »

@all
Noted BZ for ringio prefs with name "bogus string comparison". Creating of that BZ entry automatically send mail to max as well.
Post Reply