Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing for Feature Development #1

Open
akhanukov opened this issue Nov 4, 2015 · 11 comments
Open

Testing for Feature Development #1

akhanukov opened this issue Nov 4, 2015 · 11 comments

Comments

@akhanukov
Copy link

Hi @bamadesigner! So excited to start contributing. Already re-learned Git and the process and have fork and created a branch and am already developing a one-off feature (user-authentication) then looking forward to working on some Plugin integrations like for WooCommerce specifically. Hope that's ok. My question is... I installed the plugin on a test server and configured a webhook in our Slack account. When I tested sending any post change (created/published/updated/trashed/etc.), I did not receive any notification, even though that slack thread does have notification of a webhook being created. So, how best to test/debug if notifications tried getting out.. I see on the Slack side, if it was an App in my developer account, I could view some transactions. Sorry if this answered in the code somewhere which I am still going through in depth. Thought I'd get a conversation going in the meantime. Thanks! Love the idea and the code, BTW!

@akhanukov
Copy link
Author

I have tested the plugin on two different production sites on two different servers and can not get any notification from any of the Content hooks to work. However, I was able to get notifications from both user functions. I also was able to get the new User Authentication feature working and tested. I will get that branch posted on my fork and look into helping debug this issue.

@bamadesigner
Copy link
Owner

Hi! Hmm. That's weird. What about the 404 or media notifications? Have you tested those? I would recommend finding the updated_post_notification() function inside the hooks class and trying to print some variables to see if the code is being run.

The final place before sending to Slack is the send_notification() inside the notifications class.

What do you want the user authentication for?

@akhanukov
Copy link
Author

Hi! None of the 'Content' options worked on either site, including the 404. I have yet to get any notifications from the Updates section because I assume no plugins have been updated yet. I only really tested Content and Users, and then built out the User Authentication duplicating and modifying your User Added function. :) Was pretty fast. Inspired me to want to do a bunch of others. Going to commit it tonight but first I want to help debug this issue.

As far as why User Authentication? I thought you may ask :), especially if someone runs a site with hundreds or hundreds of thousands of users, it could get ugly. However, in my case, for instance, for a couple of our sites, I've always wanted to know if, when, and how often a user logs in, especially, for an eCommerce site, we could basically anticipate a purchase and potentially reach out via Chat if we see them stuck in the checkout process too long, for instance. Or for another use case, I would like to be alerted to when someone logs in so they can review a contract or page in real time. I'd like to add some sub-options to it later, potentially filtering by User Roles for instance to reduce congestion in Slack. Lastly, I thought it would be super simple to implement in one sitting (it was) and help with my first contribution to another's project. I'd love to know your thoughts.

P.S. Really, I'd love to integrate WooCommerce and BuddyPress hooks after helping with any core, but I'm really interested in your roadmap, since I'm the novice here.

@bamadesigner
Copy link
Owner

Have you been able to do any debugging to see why the notifications aren't working? The updated_post_notification() function in the hooks class would be a good place to start.

@akhanukov
Copy link
Author

Sorry, not yet. I just returned from a trip to Chicago. Am going to look and test now.

@akhanukov
Copy link
Author

Ok. This is silly, but I figured out what was happening. Not a bug at all, but maybe a lack of documentation on Slack's end. I made my default channel a private one, which the Slack interface allows me to do, with no warning that messages can't be sent there. Perhaps they can but require more or credentials, so I will check the API. As soon as I overrode the default channel with another public channel it worked fine. :) Sorry! I'll let you know what I find.

@bamadesigner
Copy link
Owner

Thanks for the feedback! I've added some text to the settings page to emphasize that users can only send to public channels and direct messages so good will come from this. :)

@akhanukov
Copy link
Author

You're welcome. All of the documentation I have searched through, says it is possible. So I did another experiment: I left my private channel as the default in my Slack Incoming Webhook but then I added it again to each event, overriding itself as the default. Now it works. So I'm inclined to believe there is a bug in the plugin code. Will dig in a bit now.

@bamadesigner
Copy link
Owner

I was thinking about this yesterday and realized I used a private channel in my testing. I don't think it's a bug. I think it's a security thing with Slack. You can use a private channel as long as it's the default channel you setup in your settings but you can't override it in the payload you send to Slack.

@akhanukov
Copy link
Author

I think I experienced the exact opposite. Private channel was my default and worked for the other functions but not for events. Unless I overrode the channel per function. Strange.

@bamadesigner
Copy link
Owner

I was trying to do some more testing before I'm on the verge of releasing an update and I set my default channel as a public one and then in my WordPress settings sent to a private channel and it worked so... hmmm... I don't know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants