« first day (2287 days earlier)      last day (2886 days later) » 

11:00
html 5 geolocation api?
I have used, but its not working in Mobile
there you go @JoeWatkins @PeeHaa
3 messages moved to Trash
!!help
Commands currently mapped:
 3v4l - Executes code snippets on 3v4l.org and displays the output (3v4l # Eval)
 > - Executes code snippets on 3v4l.org and displays the output (3v4l # Eval)
 ? - Retrieves and displays search results from Google (Google # Search)
 anmol - Get a random dad joke (JeevesDad # DadJoke)
 at - Get reminded by an elephpant because, why not? (Reminders # at)
 caniuse - A quick search tool for CanIUse, a browser comparability feature list for modern standards. (CanIUse # CanIUse)
11:02
@DaveRandom <3
1 message moved to Trash
@shubhamjain afaik you can can only use the geolocation api on https websites
Anonymous
I'd still like to be able to remove commands with !!remove
@Rovak ok
Yeah the more I use it the more i think that's the correct approach
11:03
wrong message was deleted and I got invited to trash folder ... to eat, I suppose ... filthy fucking animal ...
@PeeHaa @JayIsTooCommon I think !!remove should move the invocation messages as well
Anonymous
^ this guy
yes
Such a nice idea @DaveRandom!
Anonymous
so original!
Did you come up with that yourself :P
11:04
Oh, fuck off :-P
Anonymous
:P
/me crawls back under my rock
Happy birthday btw @tereško!
Anonymous
postMessage doesn't know what it's replying to though
11:06
/me releases 7.1.1
3
@JayIsTooCommon No, indeed. I recall I once wanted to give each plugin it's own ChatClient instance, which would be a thin wrapper class over a shared instance which has the actual logic in it, which would enable us to know which plugin posted messages. I forget the original reasoning for it.
However I do remember deciding that it shouldn't be done until the chat client implementation is decoupled from the bot and moved to a lib
I forget why
I should really write this shit down
It's probably in transcript somewhere
Anonymous
@DaveRandom for !!undo maybe?
Maybe, may also have been permissions-related
Anonymous
Yeah not sure what the best way of getting the id to post is. Is it smelly doing this in postMessage, or would you expect it to be there? github.com/Room-11/Jeeves/blob/master/src/Chat/Client/…
@JayIsTooCommon now I think about it, there isn't a 1:1 mapping between source plugin and source message, so actually that wouldn't solve the problem
The only way it can be sanely done is by passing an arg to postMessage()
Right now we can get away with modifying that API because every plugin is local, although I am loathed to do it I think it may be necessary /cc @PeeHaa
11:17
@JoeWatkins Thanks for all your hard work sire.
Would need an extra arg of type ?Message
although it can be done as Message $invocationMessage = null for 7.0 compat and because it should be optional anyway
Dunno how many contributors are actually stuck on 7
I kinda assume that if they can run 7 they can run 7.1
Anonymous
@DaveRandom well I can do that w/ modifying all plugins if you want. Though another arg would be annoying. However, though it's trivial atm, I'm sure it'll become useful in the future
Well that's true, but in this case the nullable is unnecessary since we need a default anyway
I hear whispers of people having to downgrade to 7.0 because of session handler problems ... THANKS Y. ... don't know if effecting the people doing that stuff though ...
11:20
fair enough
Anonymous
github for example, isn't always invoked by a command
@JoeWatkins Yeah I heard it too. Surprise surprise...
guy is dangerous ...
11:21
yo damien
@JoeWatkins he is
/me is going to attempt to do some work
@JayIsTooCommon Yes, go for it. I think we might need an API discussion though... I've just had another (better?) idea
@JoeWatkins oh that reminds me, I have to respond to him... and probably be ingored... again
Instead of an extra arg, we make the arg that is currently string $text into $textOrMessageObject
with some logic like:
if (!$textOrMessageObject instanceof MessageObject) {
    $textOrMessageObject = new MessageObject((string)$text, null);
}
Anonymous
Why not only messageObject?
@Leigh I just ... I ... don't know what to do about him ... I don't know if maybe there is some language barrier, or just bad attitude, or bad programmer ... or any combination thereof ... or something I haven't considered ... but he has a habit of making things awfully difficult and or stupid ...
11:26
where MessageObject is a class that contains the message text and the invocation message
@JoeWatkins People tell him not to do something, he commits it anyway
Anyone knows if in URI Authority component is obligatory?
sounds like just having it all as MessageObject would be better?
or maybe I'm missing something about it
@JayIsTooCommon Because as you rightly pointed out, sometimes there is no invoking message (or other metadata that we could potentially put in that class in the future). Sometimes passing in only a string makes the API easier to use.
@brzuchal look at your browser's address bar?
11:27
It's also a less breaking change, technically BC, since we are only widening the parameter types
@Leigh dangerous ... at what point does someone loose karma, I don't think it's ever happened ...
@brzuchal The host portion is, auth/port are not
not that this really matters here but it's good practice, and it would allow us to make the plugin changes incrementally
actually, I guess the host portion isn't....
because file://path
avoids potentially fucking up anyone elses branches that are working on plugins
11:28
@Leigh isn't that the "host" part?
Anonymous
@DaveRandom I see, the MessageObject would be here github.com/Room-11/Jeeves/tree/master/src/Chat/Entities right ?
@PeeHaa file:///tmp/x - empty host
ah right
tnx
@Leigh if host/port portion isnot obligatory and URI specifies if it's not existing then double slash '//' after protocol and :n should not exists then URI like this var:/some/path whould also be valid right?
Even var:some/path
Anonymous
To prevent noise, message and command IDs can just be ctor params? rather than setters everywhere
11:30
@JayIsTooCommon Well in theory Entities reflect structures used by SE, so no - rather I would just put it with ChatClient, it's a helper VO that is only consumed by that class
or, well, the sub-system of which that class is a part
I mean I'm sure that's debatable
@brzuchal urgh, it's complicated, because mailto:blah works, but everthing else keeps the //
But the URN example on the link you gave hints that urn:example:mammal:monotreme:echidna is completely acceptable
Yes so @JayIsTooCommon to phrase that better: the idea of entities is that they are things which are directly transmitted over the network. The ChatUser represents SE's chat user page, the MainSiteUser also represents an SE page, the PostedMessage represents a JSON object which we receive from SE
@JoeWatkins Do you have a link to this?
The point being that those things fully encapsulate those server objects
The actual problem
11:33
Yes, I am looking at php_stream_locate_url_wrapper lxr.php.net/source/xref/PHP-MASTER/main/streams/streams.c#1751 and it needs // after : to find valid streamWrapper implementation
Make sense? I'm not 100% certain it does myself
@Leigh it's mostly come via unofficial channels, emails and messages on skype ... though there is a thread on the phpredis extension regarding something about it iirc
We also have the Chat\Message\Message
I suppose there's an argument @JayIsTooCommon, in that case, that the Event and Message namespaces should be under Entities
But yeh, whatever, I hate every object model I ever made
@PeeHaa tnx
Anonymous
11:35
@DaveRandom Yep, understood. However, this chat.stackoverflow.com/transcript/message/35189411#35189411 i don't follow - eventually, every plugin should be using the object, so why would it be with chatClient?
> I would just put it with ChatClient, it's a helper VO that is only consumed by that class
that's the only thing I said which fully makes sense, even to me
Anonymous
hahah
Anonymous
that's the bit I don't understand :P
@JayIsTooCommon Because chat client is the thing which consumes it, i.e. actually does something with it
It's like I would put HTTPHeader in the same namespace as HTTPMessage @JayIsTooCommon - sure, it might be used in all kinds of places, but HTTPMessage is the only thing which actually does the action that the HTTPHeader represents.
Anonymous
ah we're talking about namespaces, not the class :P
Anonymous
11:38
I follow now
Anonymous
So you would put the MessageObject here github.com/Room-11/Jeeves/tree/master/src/Chat/Client
Oh right no it would still have it's own file :-P
@JayIsTooCommon personally yes
4 mins ago, by DaveRandom
But yeh, whatever, I hate every object model I ever made
Jeeves' chat client is actually probably the one I hate the least though
Anonymous
:P - Ok that makes sense. Though it would counteract the BC argument, I like the thought of merging room into the messageObject.. Or even merging the command object into message and using $message->command->getRoom(). Though not sure if a bit smelly.
Anonymous
and would be a PITA to change - so yes, i'll try mock something up based on ^^'' and send you the compare
@JayIsTooCommon This is a valid point, and I would say in that case that rather MessageObject should just have the id of the invoking message, rather than the entire Message
btw MessageObject needs a better name
Maybe PendingMessage
obviously postReply() can just get the id from the Message argument
so that signature doesn't need changing
Anonymous
11:50
so 3 params, ChatRoom object, Message string and Command int, for PendingMessage
function postMessage(ChatRoom $room, $textOrPendingMessage, int $flags = 0)
{
    if (!$textOrPendingMessage instanceof PendingMessage) {
        $textOrPendingMessage = new PendingMessage((string)$textOrPendingMessage, -1);
    }

    // ...
}
Anonymous
ah of course.. can't merge room because it's optional
So. I need to queue jobs for a SaaS service. When the service is down the task can be delayed, as long as one can be certain it will be send when its back up. We've made our own custom dohickey for it, which works fine. But I feel there should be a better/standard solution to do the same.
AMQP is a bit over the top.. but does anyone know some other package that could forfill these requirements ?
@JayIsTooCommon indeed, if we were going to do that we'd have to mandate the PendingMessage VO, in which case you might as well merge all the params in there - but I don't like that for a few reasons
not least of which is that the postReply() API would get clumsier
@DamienOvereem gearman?
11:56
I dont know that product, but I'll google the hell out of it. Thx!
@DamienOvereem rabbitmq might also be an option, but don't have any experience with it myself
Is it possible for php_stream_locate_url_wrapper to fix if ((*p == ':') && (n > 1) && (!strncmp("//", p+1, 2) || (n == 4 && !memcmp("data:", path, 5)))) so it woudn't require :// instead of : in paths for streamWrapper ? Or it has other implications ?
Anonymous
@DaveRandom okie doke, will give you a ping when/if I get anywhere
Yeh. I've looked at that too (we actually have a rabbitmq/amqp setup here for other goals). I am just trying to avoid too many extra moving parts because of the sensitivity/importance of the calls that have to be done.
@JayIsTooCommon kk :-)
@brzuchal yes, that has other implications. A URI does not have to have an authority record starting with // (e.g. SIP URIs)
12:01
Question for anyone. For validation ajax responses (not from a REST api), do you prefer to send status 422 or 200 if a request fails? The 200 response would have body like {"success":boolean, other fields}
lol dat rabbit hole @brzuchal
^^ both valid URIs, both things that are used in the real world
also what @PeeHaa said
@bassxzero User input validation is not exceptional/an error imo
@DaveRandom exactly but current streamWrappers doesn't support it
12:03
@brzuchal oh sorry I totally misread that
@bassxzero if it's something invalid that shouldn't happen, then return an error code/exception
Yes you should fix that
Yes it may break some real world code
No I don't give a shit because that code is bad and the authors should feel bad
However that probably won't fly as an argument on internals :-P
Anonymous
@Patrick even if there's a preventative layer on the client side?
@Patrick Are you saying "is not exceptional/an error" to the fact that 4xx is reserved for errors? Any idea why Laravel uses 422?
@DaveRandom right now it behaves like for eg. registered stream wrapper for protocol named test when making mkdir("test:some/dir", 0777, true); it uses internal file operations implementation and creates directory named test:some because internally stream wrappers are detected only if // is after test://
12:06
Okay, never used phpdbg bevore, so how do I do bt?
@Patrick I send 400s for bad user input often.
However I am a bad person in a multitude of ways
oh, back, hmmm, why? I mean wasn't bt universal enough?
@DaveRandom what do you mean ?
@brzuchal yup, that's gonna break all kinds of things
@Patrick also if you're the person that created the "no-framework-tutorial", I just want to personally thank you
12:08
@DaveRandom Yes, I am aware that on Windows platform there are paths with for eg. C:/some/dir or something like that
IMHO all those streamWrappers are shit :/
@brzuchal well there's certainly that, but also there will be people generally relying on being able to access relative paths that contain : in the first element
Their mixing responsibilities for operating on streams and traversing directories
@brzuchal Yes, yes they absolutely are
That would require an RFC ?
@DaveRandom did you find any benefits to sending 4xx vs 2xx? I'm using JQuery and the only one I can think of is that I get to separate my error code from my success code, which makes my handlers cleaner.
12:12
I've been down that rabbit hole a few times, every time I conclude that the only viable solution is to build a completely new pure-OO streams API with a BC layer for existing behaviour, which would have to be done initially as a pecl ext and then maybe, a long way down the line, if people actually use it (I would in a heartbeat) it could be merged into core and replace the existing stuff.
That BC layer for public API would always need to exist, but it can just be a wrapper which mimics existing behaviour using the new API underneath.
@brzuchal ^
@DaveRandom I was implementing a wrapper for local filesystem so I can cut off all __DIR__ concatenating and cut my paths simply binding some protocol, but the found out there is missing some interface on streamWrappers and found disadventages with those :// and found it is bad
@bassxzero Semantics, that's it. 400 is not strictly the correct response code IMO because it's supposed to indicate a problem with the HTTP message itself, but it's the closest thing there is to what I want to express afaik.
@JayIsTooCommon Then it's not input validation anymore. Invalid data trying to sneak into my domain -> exception
Anonymous
:)
@DaveRandom So basically you mean I should start doing an pecl extension for new streams?
12:16
@bassxzero Laravel does a lot of things badly. I don't know what the "proper" way is here, but I would use the same approach that I use in the rest of my application. User input validation errors are to be expected and not exceptional. If invalid data sneaks through the validation, then it's an exception/error
And that extension should wrapp all internal file operation functions with those using new implementation?
And yes I wrote the tutorial :)
So if you have client side input validation, by all means go ahead and send 4xx back if something sneaks through
Thank you all
@brzuchal It is a fucking mammoth task. If you have the time and the inclination, go for it. However step 0 is to create a working group of people to design an pairs of APIs (both userland and internal, remember that the internal streams API is used all over php-src and that's shit as well), it is vital that such an effort creates a better API, that means it needs a group of people who actually comprehend the problem to design it.
(imho)
I would be happy to contribute to such a project, but it needs a few people to get involved.
/cc @rdlowrey @kelunik @bwoebi @Trowski @WyriHaximus
I wa sgonna sk fo that :)
12:20
That's a few people with valid and useful opinions for a kick off
Nice, and I'm screved up :P
@bassxzero I prefer sending the appropriate error code (not just blindly return 422, which is stupid and wrong), if possible, but depending on server setup, you might be forced to always use 200
@DaveRandom Ok, I may try to ping all those people and asks them would they like to contribute to new streams io API
@brzuchal if should be able to act as a drop-in replacement, so it would need to redefine the userland functions to use it's impl (like mbstring can do) and it would ideally have a single header that could be included to replace the C API in a given file as well. Not sure how viable this second part is, the idea being to require minimal rewriting, at least initially, to port php-src to use the new impl
@DaveRandom Do you want an API that works for sync and async or just async?
@kelunik open question, but designing a sync API which provides existing funtionality in a sane way does not preclude an async API being created down the line
i.e. start with the (relatively) easy win, but designed carefully so as not shoot ourselves in the foot
@Sara re HashContext RFC - " This is consistent with the current behavior of the resource, but inconsistent with most class/object definitions in PHP." I'm actually starting to feel like reentrant is setting a dangerous precedent. If we introduce more object-based crypto stuff later with contexts, HashContext will be the style we copy. I don't like that we may be coerced into having reentrant contexts for things where I really don't think they belong.
@brzuchal Suggest starting by creating a github org, to which you can add me and anyone else who's interested
Also @brzuchal I was thinking that a useful way to start might be to just write some userland interfaces, which would give some shape to it and give us something concrete to discuss
@DaveRandom something like php-nio from New IO? or any other suggestions ?
whatever you like, can always rename it later :-)
12:29
I like it :)
that sounds fine to me though
Done it, I think there should be pending invitation
@brzuchal got it, thanks :-)
Ok, I may find some time to write some interfaces proposal in repository
@Jimbo how do you call a pig in spanish?
12:38
(cerdo?)
No, Baçon!
:D
Anonymous
you should be ashamed.
(el chancho as well)
12:41
@Gordon How do I call it, or what do I call it?
Oh, I saw the bacon bit
:D
!!giphy sad trombone
wut
2 messages moved to Trash
@Jimbo change your avatar
Anonymous
on LinkedIn
@Leigh do Jeeves
(please)
It can't detect a human face in mine
12:48
oh :-(
yea same
@brzuchal You can invite me, too, if you want.
Got it :)
Ugh I keep finding //F*CK! This couldn't be worse comments in this new (non-namespaced) codebase. I'm about to burn it in fire and just pass it to someone else.
What are the correct http status code for One time password failure

1. Invalid OTP
2. OTP validity time expired
3. You have tried maxium 3 wrong attempts
12:54
@Gowri Depending on your OTP implementation, 1. and 2. are the same thing.
401 for all IMO
@JoeWatkins @Jimbo (and I suppose @JayIsTooCommon and @DaveRandom too) in the interest of fairness...
ahahahaha
also quite fuckable ...
Something weirdly Lord of the Rings about that one
I used the "Baroness" filter ;)
12:56
3. probably httpstat.us/429. Depending on the implementation, you could also verify password and OTP code at once, not giving a hint whether OTP or password failed.
@kelunik invitation pending :)
@brzuchal Not any longer
Ok, qool
@DaveRandom: I want to do the different actions based on the response code
@Gowri Well, don't. HTTP does not have response codes that are that specific (those are application-level states), do something based on the response body instead
e.g. put your own error codes in a JSON message

« first day (2287 days earlier)      last day (2886 days later) »