Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes a bug in the notification extension that prevented more than one

notification.

    Fixes PR 258868

    Fixes a bug in the framework where we sent down an object for the
    itemId as opposed to the id itself. This caused the notification
    framework to remove all notifications for the app.

    Additionally changed the default itemId string to work around a
    known issue in R9E where the prefix can be used to remove all items.

    Reviewed By: Nukul Bhasin <nbhasin@rim.com>
    Tested By: Tracy Li <tli@rim.com>
  • Loading branch information...
commit 532bd8b0d0f1cb03afa4e9ea2042f19c38081319 1 parent decddde
Jeffrey Heifetz authored Nukul Bhasin committed
View
2  ext/notification/client.js
@@ -53,7 +53,7 @@ Notification = function (title, options) {
// itemId is required parameter that identifies the notification. If tag is provided it serves as an itemId, when tag isn't provided itemId is generated.
if (!options.tag) {
- options.tag = "itemId" + generateItemId();
+ options.tag = generateItemId() + "_itemId";
}
if (options.onerror || options.onshow) {
View
5 ext/notification/index.js
@@ -53,11 +53,12 @@ module.exports = {
}
// Calling delete with tag before writing new notification, ensures new notification will override the old one.
- _notification.remove(args.options);
+ _notification.remove(args.options.tag);
_notification.notify(args, getCallback(args.options.eventName));
success();
},
+
remove: function (success, fail, args) {
var key;
@@ -70,5 +71,5 @@ module.exports = {
_notification.remove(args.tag);
success();
- },
+ }
};
View
2  test/unit/ext/notification/index.js
@@ -73,7 +73,7 @@ describe("notification index", function () {
describe("notify method", function () {
afterEach(function () {
- expect(mockNotification.remove).toHaveBeenCalledWith(args.options);
+ expect(mockNotification.remove).toHaveBeenCalledWith(args.options.tag);
delete require.cache[require.resolve(_libDir + "config")];
});
Please sign in to comment.
Something went wrong with that request. Please try again.