 So it's better than I thought. Are you all for the notification types? I'm in the right room, right? Yeah, the notification does. Okay, perfect. See, it's good that I asked. It's okay, there was only one person who actually signed up. I thought it was going to be like a one-on-one thing. I was like, okay. Oh, no, it's perfectly fine. I was just like, well, that's going to be an interesting session. I'm squeezed all the way over here because I want the power. Yeah, that's fine. I'm probably going to move over there to get the power too at some point. Oh, this is for the recording. Okay, we're going to wait just a minute for any other people who are coming. Then we'll start. Yeah, while we wait. So you guys are... Tell me a little bit about what you're doing. I'm working on my work. Ah, so you do a lot of the Communitech wishlist now? Yeah, I've only been around for like four months. Okay, welcome. Yeah, yeah, so anything. Cool. You would need for a software documentation to work. Awesome. All right, so you both know of notifications, I assume. Okay, so when you log in and start editing... Hello, hello, please join. Let me see how I'm connecting my computer here. Give me one second and I'll put it up on the screen. Two-factor authentication. All right, so this hopefully will be a hands-on thing. So feel free to get your computers out. And when I finally log in, I'm going to start. Come on, computer, cooperate. Okay. All right, so for those of you who don't know, if you log in to any of our wikis, including standalone third parties, you have your username and then you have this little icon here and this little icon here. I don't know if you can see that. All right, so these two icons, right? These are showing you notifications of stuff that you did. So I have two notifications here. I hope that they're not... Anything from new topic created to mentioning. Someone mentioned me in some text. My post was edited. All that kind of stuff I'm getting notifications for. So then I can be updated on things that happen on the wiki. We also recently added, well, about six months ago, I think, added cross wiki notifications, which means I'm right now in midi wiki, but I see here that I have more alerts from Hebrew Wikipedia, which I'm also active on and I can open it up and see that I have two notifications here from Hebrew Wikipedia and if I click one of them, I'll go to Hebrew Wikipedia to whatever it talks about. So notification is pretty powerful. These are alerts. Here are notices. There is a whole list of separation in our documentation of what goes where. There's kind of like a paradigm of what should go in this side, what should go in that. There's also a lot of discussion and argument. If you don't think something should go in one way, feel free to talk in the top page. There's a lot of discussion about that anyway. But we recently also refamped it. It used to be that alerts were almost anything and then messages were pretty much only things that are strictly in your top page or in flow. We completely changed that to make it a little bit better. So these are the two things. So you have notices and you have alerts. So the question is, sorry, it used to be called echo, we're renaming it now to notifications, which is a lot clearer. The extension will be called notification. It will probably take time for us to change the actual notification, the actual code to be called that, but publicly we stop calling it echo. It's not really understandable to anyone outside of, you know, people who work on it what echo means. I should probably close my notifications. But anyway, so the notifications can also hook up to extensions. So any extension can decide that whatever it's doing can alert users for something that happened, right? So for example, flow. If you're discussing, you know, working on like a flow board you created a new topic and someone responded, the flow creates a notification that tells you if someone responded to your topic or someone, you know, closed your topic, whatever it is, right? Resolved your topic or whatever. So, and flow is an extension too. So it's not everything just in the course. So the idea is that echo or notifications, the extension is echo, can allow any extension developer to decide that they want to notify a user and then create a notification type that echo just digests, kind of, and displays to the user. So the idea of this session was to have a bit of a workshop and see how we can create new notification types. So the first thing is that if you go to mediawaiting.org extension echo, which you can hopefully see here and, okay, seriously, how do I turn off my Google Hangouts? How do I shut up? Shut up. How do I mute this? Mute. One hour. Thank you. Great. All right. Sorry about that. Anyway, so if you go to extension echo, you'll see our extension and then there's a lot of documentation. Creating a new notification type is the new tutorial that we wrote to basically go over how to create a new notification type. What I would love to do is make sure that the tutorial is clear and that, you know, even if I wasn't here, you'd be able to do it because that is the best way to know if a tutorial is clear. However, I will be here to provide any, you know, help. So first of all, is there any questions, any kind of, like, you know, things that you would like to discuss, things that you think are missing from notifications, things that you would like to do and have no idea how to do? A basic question. Can you notify users that our blog did? No. Not right now. So there is a request to do that. It's going to be very difficult. I'm not entirely sure where it is in our prioritization. One of the difficult things is that you go by IP. How do you know it is the right user? How do you notify? And then on the flip side, you can say, well, you go by IP, but then users with IP also have a talk page and that works. There's a lot of discussion about that. It was raised, but right now you can't do that. This is only for logged in users. It might in the future. I actually don't know. I think it's somewhere in discussion. Okay. So do you want to go over the tutorial? Do you want to split and do our own thing? What do you guys want to do? This is supposed to be a handsome workshop where you decide what you want to do. Is it integrated in? Not yet. No. That is a good point. I'm going to write it down for myself. We should do that. So in the example session. Yes, not yet. So my idea while attending this session, just to give you an idea, was that I wanted to get some feedback from the mass extension because some people use mass markup in a way that might not be correct. So that would be nice if we don't automatically correct it but at least suggest to the user that it could be written in a different way. Okay. For example, sometimes people tend to use italics rather than opera. And can you recognize that immediately? Yes. So the extension recognizes that and immediately corrects? So that would be a new feature. It wouldn't be correct automatically but it wouldn't suggest. For example, if you type s-i-m, it probably means backslash sign. Right. So it would be displayed as italic letters. Okay. So something like that, it wasn't in my mind. And so to create a few rumors and then send out an article to the user. Would that be something which is possible? Absolutely. Absolutely. So the way that things work in Echo. Echo has an API and the API basically says what is the type of notification that you decide. So there are several categories that you can insert. So here in this tutorial there's also code that you can actually, where is it? Here. This is the definition of the event. So you decide what your category is. This is mostly for settings. Where will it appear in settings? And then, where am I? And then a presentation model decides on the logic. When will, like how will things appear? What is the icon that you have in the notification? Because if you go to my notifications again here, you see that every notification has like an icon. And it has a header. See here, a new graded. And then it has a little blurb. And then it has secondary links. Right. So the presentation model defines all of those. Right. So then you, we can, we'll go over what the presentation model looks like. But that's where you define these. So basically you say, okay, so when, are they bundled? So what happens if I start getting five notifications from your extension? Are we going to bundle them into one notification saying your math, you know, five of your extension or whatever, five of your math operations were fixed? Right. Or are we not? Like are we, are we leaving them at this? That is another definition. User walk-ins are things to, to figure out what user to notify. In your case, it's probably very easy because you're notifying the same user who made the change. These things are more, more useful when you're notifying someone else. So for example, if I edit the page and I mention someone who you really want to notify is not me who made the change. If I notify the person who I notified. So then you would create a user locator and you say, okay, look up for whoever was notified and notify that stuff like that. So you won't need this probably. Same with user filters, user filters. If you have an extension, probably not for your case, but if you have an extension that notify someone for an action that is probably already in some cases being notified. For example, if I go into a topic that you created and in that topic I answer mentioning you, you, you should be getting a mention notification but also somewhat reply to your topic notification for the same action. So we don't want that to happen. So in the case of, I don't remember if I think mention, mentions everybody and then flow in that case checks. If there's also a mention, I'm not going to send you a notification too. So you're prioritized by that, right? So this is, these are filters that you decide. For you, it's probably not, not necessary, but these are the things. And the events. Yes. So let's go back up. All right. So the way that notifications work is that we have the actual event. It's called the Echo Event Class. And then it defines the general event. Like what is that event? What, when we did this definition here, there we go. We are basically defining the event. Okay. This is the event that I'm going to create now. Is this what you mean? Yeah. I mean, how does that get triggered? Okay. So you come, first you define the event. You define, okay, when, like, how, what does it look like? What am I going to do with it? This is the, you know, the thing of my event. Here's my icon, whatever. But that's not yet tied to any... That is not the actual trigger. So then after that, you find where in your code you want to trigger. And then you say, here, I'm going to create a new event. Right? I'm, this is my type. Here's my title, which I, you know, create an wmessage, whatever. And then if I need extra fields for my code, because my code may say, oh, I need the revision ID in order to get the snippet of the text. Or I need math, whatever. Like, maybe there's an ID for that specific event to get what they did. Whatever it is, here's more information. And then that thing is being digested by the presentation model where here's the header message. Well, okay. Am I inside a bundle? Do I have multiple things together? If I am, then this is the message that I'm going to create. If I'm not inside a bundle, this is the message I'm going to create. The message, I have parameters. So how many in the bundle? And then this is the title text. Right? What else do I have here? If it's a compact header message. The compact header message comes when you have a bundle, that when you expand it has the tiny messages, just like we saw here. So these things, this is a compact message. Because if I go to HebrewWiki, and I open it here, this time it's big. It's full size. But when it's inside this bundle, it's smaller. So that would be okay. Do you need a different kind of message for that? So here you go. So that's where you define it. So the presentation model really gives you the entire logic of how to present and builds it. It's a primary link. What happens when you click on that notification, where does it go? And then secondary links are the little buttons that you saw on the bottom. You can add one, five, 30. Please don't add 30. But you can add however many you want. So you can see it's an array. I just added one. But only in the case that it's not bundled. Because in this case, I think the example that I gave here, if you do have a bundle, they're all from the same person. So there's no need to repeat the user link in all of them. So I said, okay, if it's a bundle, don't create secondary actions. So the way that things are done are pretty... I did not even notice. Do we have anyone who's listening remotely? All right. So whoever will listen remotely, sorry. All right. So the way that Echo works, you have events. The events are actually defining what are you going to do? Is it event about mention? Is it event about math? What is it going to do? And where is it going to appear? And then you have the presentation model of how do I present it to users. That presentation model is also building everything. If you need to start saying, I need a snippet. So when I present it to the user, someone answered your topic. And then underneath, there's a piece of the answer. Hi, how are you doing? Blah. So you do know how do I take this, right? All of that, when you later on present it, that's the presentation model. Well, that depends on you, on when... No, not when the user is reading. All those details are created. Yeah, and when the event is created. What is created when the user views is the presentation itself. So it depends... So when you do... So hang on. Secondary. Here, when you define... Here. There we go. When you create, you see you have these things that I have here. The parser, getexcer. All of that. This is created once when you create the event. Because also we don't need to... If you're opening your application list, we don't need to create it again and again. It's also created once. Also the context of creating it is probably where you create the event. So all of these things of extra, these are just examples of extras. Like it really depends what you guys need in your event. Like in this case I wrote, okay, here's an expert. Excer. And here's the source of my whatever, whatever I need. Right? A revision ID. If you need something for math, it depends what details you need. Do you need the revision? Do you need also maybe something internal to the math extension that is a pointer to something? That's where you're going to put it. That will be sent to the event. And then the presentation model... You see this event, get title, and then at some point there should be get parameter. I may not have put it get parameter, but there's a way to then say, okay, give me the parameter of Rev ID. Right? And then it will give you what it built here. Right? So the presentation model is being triggered every time you look at your notification. And that part, yes, it's when you look. But all the details of, you know, how to do, you know, all the details that you need from your extension or whatever are usually when you create the event. So when would the anchor event create a thing that would be executed? Because I mean, if it were executed during page safe, it probably would slow down the older process. It shouldn't actually. We have a couple of those that are... I think the hooks, I need to check with... So let's look at, for example, the thank extension. We go to extensions. So this is the thanks extensions. Are you all familiar with the thanks extension? So basically there's a... Do you notice that? Basically there's a way for... Sorry, you're looking at unit tests from Echo. This is the thanks extension. Basically there's on revisions or on history, usually mostly on history and this. The thank extension adds a little link at the side of either history or in flow submissions like replies or something. Where you can thank whoever made that change. And then that user gets a notification saying, blah blah, thank you for this change. Which is nice. So the thank extension creates a notification. Right, so it depends. So in thanks we used... Where the hell is it? Echo Notifier. So this is before create event. Let me do it differently. I'm trying to think which one will have on page save... Mention will have on page save. Right, okay. So not thanks. Where's Echo? I mean, you could do it as a job or something. I would do it on a hook, to be honest. A lot of things are doing it on a hook and they're not that slow. The question might be which hook to use. Yeah, I would use the div or receive workhorse change. Okay, so... The moment is done on a separate request. The rendering is on a separate request, but I mean, isn't that when you would do the... I think what would make sense is to only do on a page save. Because we do other things every time. Oh, yeah. So there is normally what you get in the month, and then you create an extension, and then in order of production. Yeah. And this is like every time the page is viewed. Some caching in the month. So this is generate event. I need to check. We're using a hook for that. I don't remember which hook exactly. I think after... I'll check it out for you. But we use it a lot. We use it for... So only inside the Echo extension itself. You can see that we have a lot of built-in notifications. So this is thank you for your edit. Thank you for your 100,000, 100,000 edit. That also needs to be done at some point during edit, because then you count, right? So that kind of is done. Welcome when you log in for the first time. That's... Where is it? Reverted is probably also after edit somewhere. Edit user talk definitely after edit, if someone edits your user talk. So we have a whole bunch of those. We're using a hook for them. I just need to figure out which one. I can find that out for you. But the code is always the same. The code is just... I'm creating my event. I'm using whatever I used to define it before. I'm using whatever I used to define it before. And then I'm giving it... You see, so here the extra has the revision ID and then is minor edit. What is the section title, section text, and what is the target page that I'm going to? And then the presentation model... Let me find it. This is edit user talk. There we go. So this is the presentation model for edit user talk. It will take all of those. So for the secondary links, it will have a diff link. So of course we split it up. Here, so you get extra program, the rev ID that we just sent through the extra. And then it does the query here for the old diff, whatever, and it creates the title. All of that. So we are sending it. We're creating the event. You can create it anywhere. The only question is, when do you want it to be triggered? Ideally, it should not... You know, make things super slow. Also I know that we're using deferred actions a lot. So it should not affect the speed too much. If it starts too, that's about it. We should take care of it. But you should not be too worried about using it on edit. Depending on what... Yes. Well... If you wanted to use it to notify people of weird category intersections or something. Well, sure. I mean, everything depends on... Yeah, everything depends on... If you start seeing that your notification will come out a thousand times a minute, then probably don't do it. But in these kind of things where... It's probably not going to be a thousand times a minute. It depends on usage. And also, you might want to see, okay, whoa, I'm sending people... Too many notifications. Also, people might get annoyed with... Every time I write something, I get notifications and it's up to you to say, okay, so maybe I'll only send them a digest every week. And if that's the case, then you can't do it after Save anymore. You need to do it through some, you know, job or some whatever, whatever else, right? So that is totally up to you and the person that writes the extension or uses that system. What we do is we give you the architecture to add notification into. Also, I feel compelled to point out that if you do add some sort of notification that starts spamming users, please talk to the community about that before you do it. Because they tend to be justly so very protective about how much stuff they get. And it's also pretty understandable because if you look at those, they're small, but they are kind of distracting. And once you have something new, this will become red, this one will become blue. It's kind of like in your face a little bit. So when we changed the design of this and the number started to be a little... We made the number a little smaller because the previous one was a super big blue and red, I remember. A lot of comments about that. So just take that into account. But that is something that we give you developers the power to do. And it's great power. Comes great responsibility. But you know what I mean, right? This is the system to do it with and I'd be happy to try and work with you on adding that into the system. It's going to be a trial and error to see what makes sense in terms of how often that thing comes out and when the hook makes sense and stuff like that. But theoretically, you can put it anywhere. No, echo depends on itself. There are other things that depend on it. Echo should not have dependencies. I say too quickly. Not that I remember. Well, you know, it has dependencies of like internal core, but... Oh yeah, but no other extensions. Not that I know of, no. No, we're trying to keep echo completely separate. That's a lot of classes. Come on. So yeah, there's like media utility and EPI and stuff, but echo itself no other... Well, yeah, I think OUI is in core now. Yeah, everything is like there's no other extension. Well, OUI it requires OUI, but OUI is in core. It requires OUI requires moment JS but again, those are in core, so it shouldn't... There's no other composer. No, no, no. Well, not... What do we use in Composer? That's a good question. I am less familiar with what we're using with the composer thing. I don't think so. I think these are all peripheral. Yeah, let's see. Where's my composer file? There you go. There's like linters and stuff like that, but there's nothing actually required. And that was the original idea. A lot of other extensions may require echo, but echo, the idea was that it will be standalone, just exist. And it's on all WMF wikis? Yeah, it's on all WMF wikis. I'm trying to think if there's an extension that I know of, all projects, as far as I know, use it, and use the cross-weekly too. So... Yeah, so is there any... I think you do for an event? It depends on that. I mean, apart from the small version of the music, things like that, you know, if you're doing it to know to take into account the cross-weekly, can you not notify a cross-weekly? No. You just do it normally, and then the system knows that you've got it from X wiki, and then if you're in another wiki, it will just bundle it into the X normal wikis. You don't need to do anything. There are a bunch of ideas. There were requests. Right now we are... It's way too complicated to deal with, so right now it's not on the map, but I know that there were requests to try and have a lot of settings to say, okay, I want to be on this and this wiki, it's completely... It's very, very complicated to do, and it basically relies on global settings. So for the moment, it's not really viable. Once there's global settings, maybe. We'll see, but... There's another session, I think, that's a tough point about global settings, I believe. Yeah. I believe they said something about that, so I imagine that there is... Yeah, I was just thinking if you're running an extension that's used externally, it's worth checking that it isn't... Right, so I don't know if you saw in Thanks, which I just had open, and now... There was like a check if Echo exists. Where is my Thanks now? There we go. Looks. And then... If the class exists, Echo not a fire. So it checks, and then only if Echo exists, it does whatever. So sometimes you do need to check, or you set it up as a dependency. So that's up to you. If you want the extension to live on its own, but then only notify if Echo exists, then you can check. Otherwise, just make Echo your dependency. In WMF wikis, it's everywhere, so it's less of an issue. In standalone wikis, it depends if you have it. It's a good idea to check or announce it. Yeah. So another way, by the way, to create notification types. This is technical. So this is, if you want to sit down and actually create it, hopefully this tutorial will work. So it kind of like, it goes over a little bit about how notification works. So Echo Event, what it does, it defines basically a table, defines events. An event happens one time. So let's say I mention seven people. I have one event. Seven people will be notified, but I have one event all the time. An event is one time, and an event can also be a little complicated, but an event can also be canceled. So let's say I mentioned you in a page that was not deleted. I forgot the wiki term for it. Yeah. When an admin does that. Good lord. This session is recorded. I'm going to get flat for my team. But anyways, an event can, if it moderates, moderating things, an event can go away, and then it goes away from anyone who was notified. So an event is one event per whatever action created. And then per user, the presentation model kind of like triggers it. The presentation model is the way things look. And then this is basically what I was saying. When relevant, you create your event. If you have some user locators, it will try to find what users should get this. If you don't, it will define it will find the person that either made the event. Which usually I think about default is the person who made the event. So congratulations on your 10,000th edit. It's because you just edited it. And then it's stored in the database and twice. So once, as an event with all the details, but we also have a table that kind of says, okay, this user has that event related to them and this user has notification basically for the user so that we know that this one event has five people, but those five people need to refer to this event. It's basically stored. And then when the user requests notifications and the presentation model kicks in gets all the data from that event in the table and builds up the way things look. Is there any like you can easily create duplicates? Duplicate events? Same user, same event. Sure. But it's not the same event. It will have like an event ID that's different. For example, if I edit your talk page with laurium epsom blah and then an hour later I edit your talk page with laurium epsom blah. You'll get the same thing. Sure. Yeah, but that would be... I mean, if I was to create it, there's nothing in code that prevents me from doing it? I think the event ID will be still different. But even if the event will look exactly the same with the same revision. Good point. I think we're allowing it on purpose because there are several cases where where you want people to go to some page without a revision ID. Yeah, you're not told it. So we're allowing for that. We're assuming that whoever is creating the event will not do it unless it's on purpose. But we're allowing for that. In any case when it's in the database it will have its own event ID. So technically they're not the same event. No. You could have the same details. There's nothing preventing that from happening. So we do have an event called Create Echo Event. So you can have a Before Create Echo Event which is where you define the event which we saw with the code here. Where are you define where in the categories this fits? This is in special preferences. And then you define your event. You give it a name. This name is what you later refer to when you create it. So when you say create event you use type. This is the type that you use. So you define it. You give it... All of these are defined. Yeah, it's just... Because what I did here in this example I say this is a walkthrough. And I said let's say we have an extension in new titles created with a specific word. Yeah. So I have my extension that every time I have the hook on save or whatever it is it spotted those words. Let's take those lists of people and send them notifications. So I just called it my extension topic word. You can use whatever you want. As long as it's unique. You can use whatever you want. Usually we use some extension name and then something that makes sense. But as long as you later on refer to it when you create it. And it's not exposed to the user? No, it's just the code. Yeah, this is just the code. And then you have it... Again, this is for preferences. So you have the tooltip for the preferences. This is a message key. And then you define the actual event. There are a couple of things here that are a little bit legacy. So I'm not entirely sure what this is doing. I need to see. There's positive and negative. I'm not entirely sure. But section, alert or notice. I think in the code it's still message. This will decide if it goes in this box or that box. So you can decide. Presentation model is where your code lives for the presentation. And then this defines what bundle is doing. All of this, by the way, is defined above here. So it's kind of like you explained a little bit more in depth. There are more documentations also connected to this. So you can definitely go into the link loop where you click on more and more documentation and you drown in multiple pages to read. What I try to do is to make sure that at least the base stuff are in this page. You can go step by step, create your notification and be done. And it works. If you want to go deeper, then you can delve into the extra stuff that you can do and all the extra tricks. So the icons... No, what happens is that the icons we have in Echo base icons that you can definitely use. Where is my vagrant? There we go. Wiki, extensions. Echo, echo, echo. Okay. I think... Modules. There we go. So we have these icons that are used for like base notifications. You can use any of them if you want. If you want your own, then you need to define your own in your own extension and then link to it. If you do use your own, you need to add it with the pass. Otherwise, you can use our links. It doesn't matter. If you don't define your own, you just ignore this part. And then in the presentation model, get icon type. This type is either one of those names. So either ours or yours, there's probably icon editing tools that exist. We allow you to do whatever. Probably worthwhile to look at some of the common sizes here. Not do something humongous, but... Yeah, so... Where was I? So the icon is here, and then again. These two user locators and user filters are usually a little bit more for the advanced, usually in the basic example. Or in a fairly simple, I want to notify the same user that does this action, like in your case, you probably don't need this. Uh... And then... So in this case, I kind of gave a general idea of how to do a locator. So if I have my example extension where I have, you know, every time I save something, I look for words, and then I have a list of people interested in those words. So I'm getting the list of people, and then for those people, I'm getting out each one of them, their user. Right? This is my locator. This is how Echo will know who to send that notification to. So if you have something similar, this is more or less the way that you go. Right? You do your own thing, and you'll have to figure out your user. Um... Yeah, it's a... It's an array of callbacks. Usually you just need one, but it's an array of callbacks. So my sensor class... So after that, I just... All I got left is to actually create my code, and then it depends where you are in your code, where you want to create it. Um... You add whatever details you want, so you do need the type that has to correspond to where you created it, where you defined it. Um... Some title, but you need to be able to have for the page that is corresponding with whatever you did. Um... We usually have a title, but we don't always have a title. So there are events that don't have a title because it doesn't relate to a specific page. Um... For the most part, we... Most things do. And then extras, whatever you need to use, and agents is who triggered the event. This can be important if you are using, eventually, some job. So every week, you're going to go over and see what changes were made. Then this is important, because now it's not being triggered by some hook where you have a reference to the user that just did the action, now you're going at it interactively. So you're going to have to, oh, this user and then attach that and stuff like that. But for the most part, if it is created, you know, at the same time it's the user that triggered it. So your notification could say something like, you know, Moriel fixed up or whatever, you know, changed the text of a lot. So you know who did it. And then the presentation model. It was more or less straightforward. Get icon type. You put either your own icon name or existing icon. Can render. You need to, this is your kind of way to tell echo when it should be safe to display the notification and when it shouldn't be. So for example, in this header message, I am looking for this event get title. Right. I could spend quite a lot of time saying if this event get title exists then this event get title. But it will make my code really annoying because I will have to do it every time I get get title, which is quite a lot. Instead, I simply put, I simply say if I have a title that I can render. If I don't have a title, this entire thing can't render. When would you know if the title that you that this relate to was suppressed. You no longer have a title. It's no longer relevant. Stuff like that. So in this example, in most examples it's title, but it can also be anything else. If I don't have whatever, the revision ID, something happen, explosion of server, whatever. It could be either a bug or it could be something else. The certification doesn't render anymore. So this is a rule that's So at that point your page, your category now has 10 new pages. Usually if you do that then you will probably calculate while you create the event and then it stays there. So if you had like if say you're doing a daily service then some of those like that will not be through can render. That will be something that will have to change event and I don't know if we can change event right now. If you did something as a bundle, so if per change of links, like you know X amount of links change, so each link change you get a notification that is bundled which I don't recommend but you could do then whatever let's say link was suppressed will vanish and then your bundle will be smaller. The bundle will have 6 items and then you'll expand and you'll see 6 items and if tomorrow you'll have 4 items with bundled items it's kind of like a thing to get the balance like how many things will come within a period of time and how important is it for the user to see each and every one of them. So you know we got for example a page that you wrote or an article that you wrote was linked to this kind of thing it can happen fairly often to something if you wrote a really good article and you do want to see it happen like it's cool to see it happen but you probably don't want to start having your entire feet flooded now with a thousand people linking to your article. So in this case we bundle so you'll see only one with a little arrow down you can expand it and see however many you want but you'll see only one and the number will keep on rising and rising hopefully not at infinitum because that will be horrible but at some point we do cap so when you open the pop-up only 25 appears the latest 25 unread first and then the latest because you could also take a really old one and make it unread and then it will appear in your pop-up so any unread and then by order but you also have the page of special notifications and in this page you can see all of them so I actually don't have that many in midiwiki I do in my local machine I'll need to start turning it up and that'll take a little bit but here I only have 44 notifications if I had more then you'd just have pagination and it'll go page 2, page 3, page 4 whatever you can see only the red ones only the unread ones which I don't have any I can go red ones and then mark this as unread unread and then we'll have two so here you have a little bit more control to look at your notifications in a way that the they are the exact same presentation model that you have in here they're just a little bit more compact and here you only have 25 that's it so Hebrew Wikipedia and then this is specifically the page because if I had so if I go here in Hebrew Wikipedia and I mark as unread let's say this one and then I refresh because this is not updated immediately for various technical reasons but if I refresh now you can see that I have two pages so this kind of like and also I have two pages here so basically here in this page you can have a lot more control over your notifications you can see either everything on that wiki or I have one page that I keep getting like tons of notifications over I'll only look at that or here's my top page I'll look at that so you have a little bit more control so these are notifications that are just specifically for that or notifications from the entire wiki but again the presentation model creates the entire like thing that we see here including like this blurb like what to display in this blurb what to display in this title and the links like what links am I putting in here right so if you go to the echo extension we have formatters and in the formatters we have a whole bunch that are base presentation models we used to call them formatters we did not change the name of the folder but they are now all presentation models of kind of like the basic things that we do for everyone that have echo installed some of those are exactly that so there's mention, there's reverted there's a section edit there's user page edit all of those will use that so you can definitely so where's it this is foreign, hang on so edit threshold user mention here's mention here's page linked, there we go so this is page linked so we have we can't really see, can you so we do some processing of like you know where the diff is and then link back to the diff all that kind of stuff some of it is done on event creation but there's a lot of it that's done here like diff link to build the diff link this can render for example you can see that it's a little bit more elaborate like we want to make sure that we have because we're using diffs so we want to make sure that we have a page 2 and page from if we don't have either one of those we want to display it so you can see an example of how these things are used in the wild if you look at the entire folder here some of those are a little older so we have like an echo event digest formatter which is for email digest and stuff like that these are still kind of like the a little bit different but you have page linked you have mention you have email user notification user rights changed so you have a whole bunch of those highly recommend just take a look and then the other thing is that you can do you can look for so let's look at the page linked and then inside echo if I look for that page linked I will see see page linked this is the definition oh no this is extension this is basically the definition of my event it is in echo notifications because this is core echo so we are not using the on before echo event because we don't need to but basically this is the definition of the event so you can go over any one of those presentations that is a little bit more relevant what you want to do and see exactly this is what they are doing this is what see a group neutral I am not sure what group means but the rest again user locators so this is locate article creators we have also base locators for common things that people will probably need to do like you want to see who created the article that is a common thing on the board for flow common things that we have already so there we go on the bottom I added a little bit of pitfalls we had a couple of cases where things broke because we forgot to add proper can render and then you try to display something about an article that it doesn't exist anymore now usually what we do we do have pruning stuff so in moderation the article is taken away like whatever deleted moderated eventually we will delete the event but that probably will take time like we don't do it immediately when that happens because there are a lot of other things that happen so if you try to look at your notification while things are still running it will fail because you don't have so that happens when can render is not displayed correctly this is just a technical thing so primary link is what will happen if you click the entire notification where are you going to go there are type of notifications that don't have primary links for example welcome welcome to the wiki doesn't have link there's nowhere to take you there are a couple of arguments saying that maybe it should take you to the front page of the wiki whatever the argument results in it doesn't have a link right now but then you also have secondary links and the secondary links are the links here these things where if you have more than two so here I have one, two and then I have this that has more so you can add theoretically 30 although please don't add 30 but you can add however many you want the first two will appear on top inside the the bundle read more and if it is part of a bundle then you don't have these outside you only have the dot dot dot because as you can see it's very compact but in order to decide that the get secondary link is an array so in this case of the example I only have one thing but if you want like the diff page plus the user page and then you decide on the order the first two will likely be outside the others inside so one pitfall is to be careful because primary link if you don't have any it's false but secondary links if you don't have any it's an empty array all these kind of things are in the bottom here like what potential pitfalls you can fall into really really really really try to make sure everything is super straightforward event presentation model you create your event with the things that you want and things that you need the presentation model you just built them out also most of the presentation model you can see that in the table above is not required so there's a bunch of things that we have default behavior for that probably fits most notifications so you can basically have a really really small you know a presentation model that presents a really nice notification with that changing anything and you only change the thing so what would happen if your can render a function unspecified and your code would somehow throw out an error would it break a lot of age? no if your can render so can render has to be has to be a yes or no if you have an exception inside the can render then you'll have an exception in your code so try to make sure that that doesn't happen no I mean if it's provided right then you want to have some get message function where it produce an error what would it have also been yeah it will it will break it will probably break a code that's why we're trying to make sure that get render represents whatever you really really must have there if it breaks on get message I suspect that there will be a deeper issue than just the echo but yeah if you have exception problem then it will break the echo will not load so please check that is that an abstract? which one? oh no it defaults to true yeah can render defaults to true that's why we're trying to emphasize please write a proper one it render every time and then sometimes it just fails to display but yeah default is true is what? no because the majority of times welcome most of the things that you want to do we could say false and then turn it into true we decided that true is the simplest for the built in one yeah you know we also wanted to make sure that the API that we supply anyone else is as straight forward as possible that you can just go in and as little time as possible just write your notification and it works so yeah we can discuss whether can render can be we actually had that argument because we had like three or four that all of them I think failed at some point because something would change that caused like you know something and that's where we're kind of like we ran after them to change the can render but it happened once for like you know something really silly that happened that nobody really anticipated and it was while it was like five of them it's only five of them it's not something that was super critical it's a good point like you know we can argue about that you can basically I think the only things that you need is primary link and the header message even the subject message just uses header and the body message doesn't have to be one so basically you just need body message primary link you don't even have to have an icon if you don't want to and if you do that boom you have a notification no way there's no external API no there is an external API you can pull notifications externally but there is no I'm not sure I'm not sure that there's something that you can do from the API I'm not sure we want to but I mean there's lots of situations where a tool would leave a message for someone but then you will be notified because it's not for the message I don't know if we have something in the API external to create a notification the creation of the notification is internal it's also something we need to be very careful a lot of communities are you don't want to start slamming people with tons and tons of notifications about things that they don't care about that's another thing that's probably important when you build a notification you have the settings thing set up where is it again? in the creation of the someone can just say I don't want to see it remove it from notifications they can also decide if they want the email or web wouldn't you recommend to start with two of the signs of notifications in order to read it? because it sounds a little bit scary if I put it in an extension which is used by millions of people it will probably okay so what I would recommend you do is go to this tutorial first because this goes over each one of the steps while you're looking at this tutorial there are two places that I recommend you see the first one is echo itself in the four matters look for welcome which is this basically really small base notification you can even copy it into your extension with different messages just to see if things work it doesn't have almost anything it just has a primary link I can type that's it and apparently that's actually really weird it doesn't have anything at all but okay and then you can start moving up and seeing okay this is where am I I can see anything mention it looks really weird but if you break it apart is it inside a section is it an article top page or a user top page if it's a user's top page you can break it apart start looking at those and the other place is where is my echo and thanks so thanks extension has this is a flow presentation there we go thanks presentation model and that too is it looks long because it looks for you know get the edit comment and stuff like that but basically it's very straightforward and if you use thanks before you know what you're supposed to be getting so that's another good one to kind of like take a look at and thanks extension in general is relatively small this is where they created it this is where I'm sending it so I would recommend these three things this tutorial and then going over the presentation models and of course you can contact me at any point and I'd be really happy to help but I'm hoping that this was kind of like a jumping spot like jumping point to feel a little bit more there are two two issues one is how to display the notifications and the other one which is much more complicated for me is when to decide when to display the notification and I need to figure that out I need to somehow organize experiments therefore it would be better to do it with tools rather than directly imagine the extension itself that's a good point so here's a recommendation actually how about you start using a logger so you start instead of sending an echo event wherever you want to send that event you log and then you just read the log and you see if it starts getting to be thousands and thousands of there ok maybe not but if you see that the log is reasonable then you know that you can add an event there you can also have an event that sends itself to you like only or beta feature yeah that one is a little harder to answer preference can you default that to off? I think you can default any preference to off in media wiki but it's not through here so you can't do it here you can add it as a just a regular way that you default notifications I think pretty sure because it's just a setting I never tried that but I'm pretty sure I'm pretty sure I can do that so I think we're at the end is there anything else that I can do to help this process I'm sorry for the kind of like mixed up nature of this lecture it wasn't entirely sure what we're going to do it was depending on what people wanted to do was it okay? so feel free to contact me contact me and go to the to the tutorial the problem with this thing is that it makes the screen size bigger but not the URL so that's not helping but yeah you guys know media wiki.org and then this extension creating a new notification type and also an extension echo if you could just extension echo you have come on okay so here blah blah blah blah at the end see also you also have it thank you feel free to contact me yes yes yeah that sounds pretty awesome contact right here it's like your documentation is one of the better things I've seen on media thank you we are so trying I was so trying because I know one of the biggest frustrations is I do a lot of mentoring I had a blog and stuff