Skip to content

Commit

Permalink
[client] 도메인이 복구된 서버에 접속 시 도메인 사용자의 추방 문제 수정
Browse files Browse the repository at this point in the history
재현빙법
1. a 좀비 도메인 사용자가 있음
2. b 사용자가 2개 클라이언트로 접속
3. b 사용자 간에 추방은 되지만 도메인 종료가 되지 않는다
  • Loading branch information
powerumc committed Aug 28, 2019
1 parent df2a343 commit e7a43e6
Showing 1 changed file with 17 additions and 25 deletions.
42 changes: 17 additions & 25 deletions client/Ntreev.Crema.Client.Tables/TableServiceViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,18 +237,20 @@ private async void Restore(IDataBase dataBase)
var itemPath = item.DomainInfo.ItemPath;
var itemType = item.DomainInfo.ItemType;

if (item.Host is IDomainHost host)
{
host.OnRestoredEvent((Domain)item);
}

if (item.Host is ITableContent content)
{
if (users.Any(user => user.UserID == this.authenticator.ID) == false) continue;

var table = content.Table;
var tableDescriptor = this.browser.GetDescriptor(table.Path) as ITableDescriptor;
restoreList.Add(new System.Action(() => {
restoreList.Add(new System.Action(() =>
{
this.DocumentService.OpenTable(this.authenticator, tableDescriptor);
if (item.Host is IDomainHost host)
{
host.OnRestoredEvent((Domain)item);
}
}));
}
else if (item.Host is ITableTemplate template)
Expand All @@ -259,36 +261,26 @@ private async void Restore(IDataBase dataBase)
{
var category = dataBase.TableContext[itemPath] as ITableCategory;
var dialog = new NewTableViewModel(this.authenticator, category, template);
restoreList.Add(new System.Action(() => {
if (item.Host is IDomainHost host)
{
host.OnRestoredEvent((Domain)item);
}

dialog.ShowDialog(); }));
restoreList.Add(new System.Action(() =>
{
dialog.ShowDialog();
}));
}
else if (itemType == "NewChildTableTemplate")
{
var table = dataBase.TableContext[itemPath] as ITable;
var dialog = new NewChildTableViewModel(this.authenticator, table, template);
restoreList.Add(new System.Action(() => {
if (item.Host is IDomainHost host)
{
host.OnRestoredEvent((Domain)item);
}

dialog.ShowDialog(); }));
restoreList.Add(new System.Action(() =>
{
dialog.ShowDialog();
}));
}
else if (itemType == "TableTemplate")
{
var table = dataBase.TableContext[itemPath] as ITable;
var dialog = new EditTemplateViewModel(this.authenticator, table, template);
restoreList.Add(new System.Action(() => {
if (item.Host is IDomainHost host)
{
host.OnRestoredEvent((Domain)item);
}

restoreList.Add(new System.Action(() =>
{
dialog.ShowDialog();
}));
}
Expand Down

0 comments on commit e7a43e6

Please sign in to comment.