Commit graph

339 commits

Author SHA1 Message Date
friendica
a496036066 local_user => local_channel 2015-01-28 20:56:04 -08:00
friendica
6c7269be94 add yet another firehose check 2015-01-28 01:13:32 -08:00
friendica
9feb300f47 more minor tweaks to the route mismatch algorithm after watching it all day. 2015-01-28 01:06:56 -08:00
friendica
85b359e25c ignore route mismatches on firehose posts to the sys channel. Use whatever parent route we have. By definition we aren't going to have permission issues with these things. 2015-01-27 17:53:19 -08:00
friendica
21f85b32ec we need to actually ask for the id from the DB if we want to use it. 2015-01-27 17:46:16 -08:00
friendica
2f4ef7660c improved route mismatch detection. We will be less strict about the absolute route matching and only look at the last hop before it got to us - which is ultimately all we should care about (since that sender controls the thread permissions). Route mismatches seem to occur somewhat frequently from yamkote (for unknown reasons), and the logging has been improved a bit so it should provide some slightly more useful debugging info in case it still happens going forward. Oh, also we'll set the parent on comments when we store the initial post (item_store()) and only go back and set the parent for top-level posts. This should reduce the number of comments with missing parents on shared hosts, but may increase the number of missing threads. Probably worthwhile to do a query occasionally for parent = 0 and see how we're doing and how many have shared host related delivery issues. 2015-01-27 15:47:24 -08:00
friendica
fc62d7e577 handle an incoming directory rating message 2015-01-26 19:43:39 -08:00
Habeas Codice
1d6aead325 remove superfluous group by
this gets called from a zot post_post dealing with a specific messageid and hubloc_hash combination. grouping by site
doesn't make sense here and it gets grouped when pulled back out elsewhere anyway
2015-01-24 22:07:53 -08:00
friendica
76fe9dc702 zot_finger second arg is optional but function declaration didn't specify this - causes issue with check_upstream_directory 2015-01-21 20:08:10 -08:00
friendica
10102ac2ac connection clone issues 2015-01-10 14:59:10 -08:00
friendica
fbe0610ce9 don't update locally deleted items 2015-01-06 15:44:23 -08:00
friendica
452d275b5e don't import to sys channel from self-censored authors 2014-12-12 00:26:07 -08:00
friendica
8e4e56b566 can't reset public to false because it may have been passed in as true and this would be wrong and cause even more subtle bugs. Reset to whatever value was passed in. 2014-12-01 18:59:38 -08:00
Thomas Willingham
def10df816 Somewhat subtle process_delivery() bug - $public was not being reset if a sys
channel is reached but then the loop iterated over another channel.
2014-12-01 19:09:50 +00:00
friendica
18cae8a78c change logging of some troublesome or noisy bits so we can figure out what is really going on 2014-11-19 19:22:22 -08:00
friendica
7fec939c23 couple of fixes:
- significantly increase the content availability on the discover channel
- fix the button group on the blog/list mode which made the border on a single comment button a bit wonky
2014-11-19 14:41:24 -08:00
friendica
4893e64c1e there's still a permission issue delivering a public post directly to the sys channel (on the local system), but this puts the local sys channel in the public delivery chain and fixes an issue with unseen counts showing on the discover page (where you can't do anything about it). 2014-11-19 00:56:05 -08:00
friendica
efcbcd6f88 add sys channel to public recips if scope public 2014-11-18 20:34:47 -08:00
friendica
b5da015789 put timeout code in place but don't turn it on. 2014-11-13 15:34:35 -08:00
Habeas Codice
ac27db22c1 Merge remote-tracking branch 'upstream/master'
Conflicts:
	boot.php
	include/dba/dba_driver.php
	include/diaspora.php
	include/follow.php
	include/session.php
	include/zot.php
	mod/photos.php
	mod/ping.php
2014-11-13 13:06:31 -08:00
Habeas Codice
1a5a5c7edb PostgreSQL support initial commit
There were 11 main types of changes:
- UPDATE's and DELETE's sometimes had LIMIT 1 at the end of them. This is not only non-compliant but
it would certainly not do what whoever wrote it thought it would. It is likely this mistake was just
copied from Friendica. All of these instances, the LIMIT 1 was simply removed.
- Bitwise operations (and even some non-zero int checks) erroneously rely on MySQL implicit
integer-boolean conversion in the WHERE clauses. This is non-compliant (and bad programming practice
to boot). Proper explicit boolean conversions were added. New queries should use proper conventions.
- MySQL has a different operator for bitwise XOR than postgres. Rather than add yet another dba_
func, I converted them to "& ~" ("AND NOT") when turning off, and "|" ("OR") when turning on. There
were no true toggles (XOR). New queries should refrain from using XOR when not necessary.
- There are several fields which the schema has marked as NOT NULL, but the inserts don't specify
them. The reason this works is because mysql totally ignores the constraint and adds an empty text
default automatically. Again, non-compliant, obviously. In these cases a default of empty text was
added.
- Several statements rely on a non-standard MySQL feature
(http://dev.mysql.com/doc/refman/5.5/en/group-by-handling.html). These queries can all be rewritten
to be standards compliant. Interestingly enough, the newly rewritten standards compliant queries run
a zillion times faster, even on MySQL.
- A couple of function/operator name translations were needed (RAND/RANDOM, GROUP_CONCAT/STRING_AGG,
UTC_NOW, REGEXP/~, ^/#) -- assist functions added in the dba_
- INTERVALs: postgres requires quotes around the value, mysql requires that there are not quotes
around the value -- assist functions added in the dba_
- NULL_DATE's -- Postgres does not allow the invalid date '0000-00-00 00:00:00' (there is no such
thing as year 0 or month 0 or day 0). We use '0001-01-01 00:00:00' for postgres. Conversions are
handled in Zot/item packets automagically by quoting all dates with dbescdate().
- char(##) specifications in the schema creates fields with blank spaces that aren't trimmed in the
code. MySQL apparently treats char(##) as varchar(##), again, non-compliant. Since postgres works
better with text fields anyway, this ball of bugs was simply side-stepped by using 'text' datatype
for all text fields in the postgres schema. varchar was used in a couple of places where it actually
seemed appropriate (size constraint), but without rigorously vetting that all of the PHP code
actually validates data, new bugs might come out from under the rug.
- postgres doesn't store nul bytes and a few other non-printables in text fields, even when quoted.
bytea fields were used when storing binary data (photo.data, attach.data). A new dbescbin() function
was added to handle this transparently.
- postgres does not support LIMIT #,# syntax. All databases support LIMIT # OFFSET # syntax.
Statements were updated to be standard.

These changes require corresponding changes in the coding standards. Please review those before
adding any code going forward.

Still on my TODO list:
- remove quotes from non-reserved identifiers and make reserved identifiers use dba func for quoting
- Rewrite search queries for better results (both MySQL and Postgres)
2014-11-13 12:21:58 -08:00
friendica
5619902776 indicate public forums in directory results (there will be some [possibly considerable] lag time before existing forums are correctly tagged). 2014-11-10 17:44:02 -08:00
friendica
6209465233 add public forum identification to libzot. No attempt is made to identify other types of forums or weird custom channel permissions. If the channel is auto-accept and taggable, it's a public forum. 2014-11-10 15:21:04 -08:00
zottel
1f35d9432f don't overwrite $x (contains import_xchan result) with role permissions 2014-11-06 17:24:05 +01:00
friendica
d5d6158973 ok heads up - potentially destabilising change. I've tried to sort out all the default connection permissions for those who don't have a predefined (or therefore have a "custom") permissions role. Unfortunately this includes most people that were using this software more than a month ago. The real changes are that the SELF address book entry no longer holds "auto-permissions" but instead holds your "default permissions" (if you have a pre-defined role, the defaults will be pulled from the role table).
The auto permissions have moved to a pconfig (uid.system.autoperms). A DB update will move these settings into their new homes.

What used to be the "Auto-permissions settings" page is now the "default permissions settings" page and a checkbox therein decides whether or not to apply the permissions automatically. A link to this page will only be shown when you have the "custom" role selected.

With luck nobody will notice anything wrong. But at least for the next few days, please review permissions that have been assigned to new connections (either automatically or manually) and make sure they make sense (e.g. they aren't "nothing"). You still need to take action when seeing a message "permissions have changed but not yet submitted" as we always let you review and perhaps adjust the settings _before_ a connection is established (unless you have autoperms turned on).
2014-11-04 17:11:02 -08:00
friendica
0e4f318b71 php warnings 2014-11-02 19:22:18 -08:00
friendica
285d6f61e4 I'm going to try again with the conversation request packets. I've looked this over and tested a lot of edge cases, and thought about from every angle I can think of to prevent looping. I don't *think* this can loop. I also doubt that this is the problem at friendicared.de, but I don't know for sure what that problem might be. 2014-11-02 15:28:20 -08:00
friendica
4274a2d06c add some more safety checks before turning the conversation request messages back on 2014-11-02 00:06:52 -07:00
friendica
50c16c394f check that we have valid data 2014-11-01 01:52:27 -07:00
friendica
a659ac8952 disable request message response until we work through this 2014-11-01 00:36:21 -07:00
friendica
1cb45c30e9 document request packets a bit more 2014-10-31 06:24:14 -07:00
friendica
5637d07138 flag notify packets that are sent in response to a message_id request and prevent them from recursing 2014-10-31 04:59:30 -07:00
friendica
28a35261db What this checkin does is catch the case where a comment arrived and there's a missing top-level post to match it with. So we'll send a request back to the sender that you've never seen this thread and please send a fresh copy of the entire conversation to date. We could soon have posts in the matrix from different platforms from days gone by, which have been migrated into the modern world. We'll be polite and not deliver these to everybody. However, if someone comments on one of these antique threads we wouldn't be able to see it in our own matrix because we won't have a copy of the parent post. So this rectifies that situation. Be aware that item deletion may need to change to keep "hard deleted" items indefinitely so that they don't keep coming back. We'll have to null out the important data of the former item to accomplish the deletion aspect. 2014-10-30 19:15:03 -07:00
friendica
fd492386bf Tried this once before but had to revert. Basically prevent a comment from being relayed more than once - as it's a huge drain on resources. But last time I tried this, wall-to-wall comments stopped getting relayed. This checkin should do the right thing in both conditions. 2014-10-19 17:31:10 -07:00
friendica
903f7e73fb if a hubloc primary change results in an xchan primary change, create a directory update packet. 2014-10-13 21:44:46 -07:00
friendica
0057612a9f figuring out how to bootstrap the change_primary procedure when all you have is inconsistent data which you think you trust. 2014-10-13 21:38:36 -07:00
friendica
19e1b95837 don't use cached data 2014-10-13 21:01:51 -07:00
friendica
bd4dd85fbb there's the problem 2014-10-13 20:53:34 -07:00
friendica
1b0390af06 new function hubloc_change_primary() 2014-10-13 15:27:56 -07:00
friendica
718bea5d45 cleanup of sync_locations and better logging. There was one significant code change but it is unrelated to current issues, basically if no primary was set we were setting everything as primary. 2014-10-12 15:18:49 -07:00
friendica
f26cd5a636 ah yes, the redundant relay run was for the benefit of wall-to-wall posts issue #633 2014-10-10 15:17:32 -07:00
friendica
b5f91d7b40 missing source route after edit 2014-10-10 14:45:18 -07:00
friendica
cde244ef74 improvement in source route checking when handling complex *upstream* delivery chains, which were not adequately accounted for in the earlier checkin. 2014-10-10 00:13:46 -07:00
friendica
4634049549 allow (our own) ajax urls to pass through bbcode intact. 2014-10-09 20:59:33 -07:00
friendica
effc8960c3 OK this is important. So read it carefully.
This checkin implements route matching of comments so that they are only accepted from the same route as the top-level post they are attached to. This way there should be no mis-match of permissions between any posts in the thread. It may not be completely compatible with comments posted in the past (though I've tried to be, there may be some minor issues). In addition it seems that relaying was invoked more often than necessary - especially when a duplicate post arrived which was not processed because the edited time hadn't changed - it still invoked relaying. This fix should improve site performance considerably for comments cross-posted to forums; which got bounced around a bit and delivered redundantly for no reason.

Roll this back *only* if it causes a meltdown or comment loss is "serious" (as in OMG people are dying, make it stop!). If we can get past 24 hours without serious issue we need to get everybody onto this code. There may be some minor comment loss (mostly affecting new comments to older posts or likes of older comments) until the majority of sites have moved to the new code.

It may be difficult or impossible to deliver comments to posts that pre-date the addition of source routes (April 1, 2014) to anybody but the top-level post author at his/her primary hub. We may wish to close comments on these posts, but let's see how we go before doing that.
2014-10-09 18:12:53 -07:00
friendica
467c6c72f0 ability to pre-populate connections for new channels. e.g. "MySpace Tom" 2014-10-01 14:48:08 -07:00
friendica
b735961560 found the sucker 2014-09-22 16:23:59 -07:00
friendica
c4608d4c82 just mark dead hubloc deleted - don't remove them. This could cause problems. Also clean up fetch_url/post_url header option 2014-09-16 19:07:19 -07:00
friendica
bbc9e4427e honour service class restrictions for total_identities, total_channels ("friends") and total_feeds both when importing channels and subsequently when syncing clones. Limits are based on the local system - additional entries are silently dropped. 2014-09-15 17:17:00 -07:00
friendica
0dc33900b6 provide a way to sync locations and get rid of bogus hublocs, now implemented 2014-09-14 22:19:19 -07:00